947ff73f6ee4445e0be04ac0326542d241f2fa43
[ci-management.git] / jjb / doc / doc-templates-rtd.yaml
1 ---
2 - job-template:
3     # Job template for verifying Sphinx/Restructured Text for RTD
4     #
5     # The purpose of this job template is verify documentation source
6     #
7     # Required Variables:
8     #     branch:        git branch
9     # Optional Variables:
10     #     path:      directory containing the project's tox.ini relative to
11     #                the workspace. The default is the project root.
12
13     name: '{project-name}-{stream}-verify-rtd'
14     path: '$WORKSPACE'
15
16     project-type: freestyle
17     concurrent: true
18     node: '{build-node}'
19
20     properties:
21       - infra-properties:
22           build-days-to-keep: '{build-days-to-keep}'
23
24     parameters:
25       - infra-parameters:
26           project: '{project}'
27           branch: '{branch}'
28           refspec: 'refs/heads/{branch}'
29           artifacts: '{archive-artifacts}'
30       - maven-exec:
31           maven-version: '{maven-version}'
32
33     scm:
34       - git:
35           credentials-id: '{jenkins-ssh-credential}'
36           url: '$GIT_BASE'
37           refspec: ''
38           choosing-strategy: 'gerrit'
39           branches:
40             - 'origin/$GERRIT_BRANCH'
41           skip-tag: true
42           wipe-workspace: true
43           submodule:
44             recursive: '{submodule-recursive}'
45
46     wrappers:
47       - infra-wrappers:
48           build-timeout: '{build-timeout}'
49
50     triggers:
51       - gerrit-trigger-patch-submitted:
52           server: '{server-name}'
53           project: '**'
54           branch: '{branch}'
55           files: 'docs/**/*.rst'
56       - timed: 'H H * * *'
57
58     builders:
59       - shell: |
60           if [ "$GERRIT_PROJECT" != "doc" ]; then
61               cd docs/submodules/$GERRIT_PROJECT
62               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
63           else
64               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
65           fi
66       - shell: |
67           #!/bin/bash
68           virtualenv $WORKSPACE/venv-tox
69           source $WORKSPACE/venv-tox/bin/activate
70           pip install --upgrade pip
71           pip install --upgrade tox argparse
72           pip freeze
73           cd $WORKSPACE/{path}
74           tox
75
76     publishers:
77       - infra-shiplogs:
78           maven-version: '{maven-version}'
79
80 - job-template:
81     # Job template for merging/publishing Sphinx/Restructured Text at RTD
82     #
83     # The purpose of this job template is to trigger updates after
84     # a merge of documentation source in gerrit
85     #
86     # Required Variables:
87     #     branch:        git branch
88     #     rtdproject:    name of a project at readthedocs.io
89     # Optional Variables:
90     #     path:      directory containing the project's tox.ini relative to
91     #                the workspace. The default is the project root.
92
93     name: '{project-name}-{stream}-merge-rtd'
94     path: '$WORKSPACE'
95
96     project-type: freestyle
97     concurrent: false
98     node: '{build-node}'
99
100     properties:
101       - infra-properties:
102           build-days-to-keep: '{build-days-to-keep}'
103
104     parameters:
105       - infra-parameters:
106           project: '{project}'
107           branch: '{branch}'
108           refspec: 'refs/heads/{branch}'
109           artifacts: '{archive-artifacts}'
110       - maven-exec:
111           maven-version: '{maven-version}'
112
113     scm:
114       - git:
115           credentials-id: '{jenkins-ssh-credential}'
116           url: '$GIT_BASE'
117           refspec: ''
118           choosing-strategy: 'gerrit'
119           branches:
120             - 'refs/heads/{branch}'
121           skip-tag: true
122           wipe-workspace: true
123           submodule-recursive: '{submodule-recursive}'
124
125
126     wrappers:
127       - infra-wrappers:
128           build-timeout: '{build-timeout}'
129
130     triggers:
131       - gerrit:
132           server-name: '{server-name}'
133           trigger-on:
134             - change-merged-event
135             - comment-added-contains-event:
136                 comment-contains-value: 'remerge'
137           projects:
138             - project-compare-type: 'ANT'
139               project-pattern: '**'
140               branches:
141                 - branch-compare-type: 'ANT'
142                   branch-pattern: '**/{branch}'
143               file-paths:
144                 - compare-type: ANT
145                   pattern: docs/**/*.rst
146
147     builders:
148       - shell: !include-raw: doc-post-rtd.sh
149
150     publishers:
151       - infra-shiplogs:
152           maven-version: '{maven-version}'
153