2dfab6ea37bbf9f4850515d5253c4f804c7ba8d9
[releng/global-jjb.git] / 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     # Optional parameters:
172     #
173     #     :branch: Git branch to fetch for the build. (default: master)
174     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
175     #     :build-node: The node to run build on.
176     #     :build-timeout: Timeout in seconds before aborting build. (default: 15)
177     #     :doc-dir: Directory where tox will place built docs.
178     #         as defined in the tox.ini (default: docs/_build/html)
179     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
180     #     :stream: Keyword that can be used to represent a release code-name.
181     #         Often the same as the branch. (default: master)
182     #     :submodule-recursive: Whether to checkout submodules recursively.
183     #         (default: true)
184
185     ######################
186     # Default parameters #
187     ######################
188
189     branch: master
190     build-days-to-keep: 7
191     build-timeout: 15
192     doc-dir: docs/_build/html
193     git-url: '$GIT_URL/$PROJECT'
194     stream: master
195     submodule-recursive: true
196
197     #####################
198     # Job Configuration #
199     #####################
200
201     builders:
202       - lf-rtd-verify:
203           doc-dir: '{doc-dir}'
204
205 - job-template:
206     name: '{project-name}-rtd-verify-{stream}'
207     id: gerrit-rtd-verify
208     concurrent: true
209     <<: *lf_rtd_common
210     # yamllint disable-line rule:key-duplicates
211     <<: *lf_rtd_verify
212
213     scm:
214       - lf-infra-gerrit-scm:
215           branch: '{branch}'
216           jenkins-ssh-credential: '{jenkins-ssh-credential}'
217           git-url: '{git-url}'
218           refspec: ''
219           submodule-recursive: '{submodule-recursive}'
220           choosing-strategy: default
221
222     triggers:
223       - gerrit:
224           server-name: '{gerrit-server-name}'
225           trigger-on:
226             - change-merged-event
227             - comment-added-contains-event:
228                 comment-contains-value: 'recheck$'
229           projects:
230             - project-compare-type: 'ANT'
231               project-pattern: '**'
232               branches:
233                 - branch-compare-type: 'ANT'
234                   branch-pattern: '**/{branch}'
235               file-paths: '{obj:gerrit_trigger_file_paths}'
236
237 - job-template:
238     name: '{project-name}-rtd-verify-{stream}'
239     id: github-rtd-verify
240     concurrent: true
241     <<: *lf_rtd_common
242     # yamllint disable-line rule:key-duplicates
243     <<: *lf_rtd_verify
244
245     properties:
246       - github:
247           url: '{git-url}/{github-org}/{project}'
248
249     scm:
250       - lf-infra-github-scm:
251           url: '{git-clone-url}{github-org}/{project}'
252           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
253           branch: '{branch}'
254           submodule-recursive: '{submodule-recursive}'
255           choosing-strategy: default
256           jenkins-ssh-credential: '{jenkins-ssh-credential}'
257
258     triggers:
259       - lf-infra-github-pr-trigger:
260           trigger-phrase: '^recheck$'
261           only-trigger-phrase: false
262           status-context: 'RTD Verify'
263           permit-all: true
264           github-hooks: true
265           github-org: ''
266           github_pr_whitelist:
267             - ''
268           github_pr_admin_list:
269             - ''