Generalize odl rtd jobs for global-jjb
[releng/global-jjb.git] / jjb / lf-rtd-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-rtd-jobs'
4
5     # This job group contains all the ReadTheDocs jobs
6
7     jobs:
8       - gerrit-rtd-merge
9       - gerrit-rtd-verify
10
11 - job-group:
12     name: '{project-name}-github-rtd-jobs'
13
14     # This job group contains all the ReadTheDocs jobs
15
16     jobs:
17       - github-rtd-merge
18       - github-rtd-verify
19
20 ####################
21 # COMMON FUNCTIONS #
22 ####################
23
24 - lf_rtd_common: &lf_rtd_common
25     name: lf-rtd-common
26     # RTD verify and merge jobs are the same except for their scm, trigger, and
27     # builders definition. This anchor is the common template
28     #
29     # Optional parameters:
30     #     :gerrit_trigger_file_paths: Override file paths which can be used to
31     #         filter which file modifications will trigger a build.
32     #         (default: - compare-type: ANT
33     #                     pattern: '**/*.rst'
34     #                   - compare-type: ANT
35     #                     pattern: '**/conf.py')
36
37     ######################
38     # Default parameters #
39     ######################
40
41     gerrit_trigger_file_paths:
42       - compare-type: ANT
43         pattern: '**/*.rst'
44       - compare-type: ANT
45         pattern: '**/conf.py'
46
47     #####################
48     # Job Configuration #
49     #####################
50
51     project-type: freestyle
52     node: '{build-node}'
53
54     properties:
55       - lf-infra-properties:
56           build-days-to-keep: 7
57
58     parameters:
59       - lf-infra-parameters:
60           project: '{project}'
61           branch: '{branch}'
62           refspec: 'refs/heads/{branch}'
63           stream: '{stream}'
64           lftools-version: '{lftools-version}'
65
66     wrappers:
67       - lf-infra-wrappers:
68           build-timeout: '{build-timeout}'
69           jenkins-ssh-credential: '{jenkins-ssh-credential}'
70
71     publishers:
72       - lf-infra-publish
73
74 #############
75 # RTD MERGE #
76 #############
77
78 - lf_rtd_merge: &lf_rtd_merge
79     name: lf-rtd-merge
80
81     # Merge job which triggers a POST of the docs project to readthedocs
82     #
83     # Required parameters:
84     #
85     #     :rtd-project: This is the name of the project on ReadTheDocs.org.
86     #
87     # Optional parameters:
88     #
89     #     :branch: Git branch to fetch for the build. (default: master)
90     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
91     #     :build-node: The node to run build on.
92     #     :build-timeout: Timeout in seconds before aborting build. (default: 15)
93     #     :git-url: base URL of git project. (default: https://github.com)
94     #     :stream: Keyword that can be used to represent a release code-name.
95     #         Often the same as the branch. (default: master)
96
97     ######################
98     # Default parameters #
99     ######################
100
101     branch: master
102     build-days-to-keep: 7
103     build-timeout: 15
104     git-url: https://github.com
105     stream: master
106     submodule-recursive: true
107
108     #####################
109     # Job Configuration #
110     #####################
111
112     builders:
113       - lf-rtd-trigger-build:
114           rtd-project: '{rtd-project}'
115
116 - job-template:
117     name: '{project-name}-rtd-merge-{stream}'
118     id: gerrit-rtd-merge
119     <<: *lf_rtd_common
120     # yamllint disable-line rule:key-duplicates
121     <<: *lf_rtd_merge
122
123     triggers:
124       - gerrit:
125           server-name: '{gerrit-server-name}'
126           trigger-on:
127             - change-merged-event
128             - comment-added-contains-event:
129                 comment-contains-value: 'remerge$'
130           projects:
131             - project-compare-type: 'ANT'
132               project-pattern: '**'
133               branches:
134                 - branch-compare-type: 'ANT'
135                   branch-pattern: '**/{branch}'
136               file-paths: '{obj:gerrit_trigger_file_paths}'
137
138 - job-template:
139     name: '{project-name}-rtd-merge-{stream}'
140     id: github-rtd-merge
141     <<: *lf_rtd_common
142     # yamllint disable-line rule:key-duplicates
143     <<: *lf_rtd_merge
144
145     properties:
146       - github:
147           url: '{git-url}/{github-org}/{project}'
148
149     triggers:
150       - lf-infra-github-pr-trigger:
151           trigger-phrase: '^remerge$'
152           only-trigger-phrase: false
153           status-context: 'RTD Merge'
154           permit-all: true
155           github-hooks: true
156           github-org: ''
157           github_pr_whitelist:
158             - ''
159           github_pr_admin_list:
160             - ''
161       - timed: 'H H * * *'
162
163 #############
164 # RTD VERIFY#
165 #############
166
167 - lf_rtd_verify: &lf_rtd_verify
168     name: lf-rtd-verify
169     # Verify job which runs a tox build of the docs project
170     #
171     # Required parameters:
172     #
173     #     :rtd-project: This is the name of the project on ReadTheDocs.org.
174     #
175     # Optional parameters:
176     #
177     #     :branch: Git branch to fetch for the build. (default: master)
178     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
179     #     :build-node: The node to run build on.
180     #     :build-timeout: Timeout in seconds before aborting build. (default: 15)
181     #     :doc-dir: Directory where tox will place built docs.
182     #         as defined in the tox.ini (default: docs/_build/html)
183     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
184     #     :stream: Keyword that can be used to represent a release code-name.
185     #         Often the same as the branch. (default: master)
186     #     :submodule-recursive: Whether to checkout submodules recursively.
187     #         (default: true)
188
189     ######################
190     # Default parameters #
191     ######################
192
193     branch: master
194     build-days-to-keep: 7
195     build-timeout: 15
196     doc-dir: docs/_build/html
197     git-url: '$GIT_URL/$PROJECT'
198     stream: master
199     submodule-recursive: true
200
201     #####################
202     # Job Configuration #
203     #####################
204
205     builders:
206       - lf-rtd-verify:
207           doc-dir: '{doc-dir}'
208
209 - job-template:
210     name: '{project-name}-rtd-verify-{stream}'
211     id: gerrit-rtd-verify
212     concurrent: true
213     <<: *lf_rtd_common
214     # yamllint disable-line rule:key-duplicates
215     <<: *lf_rtd_verify
216
217     scm:
218       - lf-infra-gerrit-scm:
219           branch: '{branch}'
220           jenkins-ssh-credential: '{jenkins-ssh-credential}'
221           git-url: '{git-url}'
222           refspec: ''
223           submodule-recursive: '{submodule-recursive}'
224           choosing-strategy: default
225
226     triggers:
227       - gerrit:
228           server-name: '{gerrit-server-name}'
229           trigger-on:
230             - change-merged-event
231             - comment-added-contains-event:
232                 comment-contains-value: 'recheck$'
233           projects:
234             - project-compare-type: 'ANT'
235               project-pattern: '**'
236               branches:
237                 - branch-compare-type: 'ANT'
238                   branch-pattern: '**/{branch}'
239               file-paths: '{obj:gerrit_trigger_file_paths}'
240
241 - job-template:
242     name: '{project-name}-rtd-verify-{stream}'
243     id: github-rtd-verify
244     concurrent: true
245     <<: *lf_rtd_common
246     # yamllint disable-line rule:key-duplicates
247     <<: *lf_rtd_verify
248
249     properties:
250       - github:
251           url: '{git-url}/{github-org}/{project}'
252
253     scm:
254       - lf-infra-github-scm:
255           url: '{git-clone-url}{github-org}/{project}'
256           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
257           branch: '{branch}'
258           submodule-recursive: '{submodule-recursive}'
259           choosing-strategy: default
260           jenkins-ssh-credential: '{jenkins-ssh-credential}'
261
262     triggers:
263       - lf-infra-github-pr-trigger:
264           trigger-phrase: '^recheck$'
265           only-trigger-phrase: false
266           status-context: 'RTD Verify'
267           permit-all: true
268           github-hooks: true
269           github-org: ''
270           github_pr_whitelist:
271             - ''
272           github_pr_admin_list:
273             - ''