0a757e85b738bcd392086042a50b1c302f22ab47
[releng/global-jjb.git] / lf-rtd-jobs.yaml
1 ---
2 ####################
3 # COMMON FUNCTIONS #
4 ####################
5
6 - lf_rtd_common: &lf_rtd_common
7     name: lf-rtd-common
8
9     ######################
10     # Default parameters #
11     ######################
12
13     gerrit_trigger_file_paths:
14       - compare-type: REG_EXP
15         pattern: '.*\.css'
16       - compare-type: REG_EXP
17         pattern: '.*\.html'
18       - compare-type: REG_EXP
19         pattern: '.*\.rst'
20       - compare-type: REG_EXP
21         pattern: '.*\/conf.py'
22
23     # github_included_regions MUST match gerrit_trigger_file_paths
24     github_included_regions:
25       - '.*\.css'
26       - '.*\.html'
27       - '.*\.rst'
28       - '.*\/conf.py'
29
30     #####################
31     # Job Configuration #
32     #####################
33
34     project-type: freestyle
35     node: "{build-node}"
36
37     properties:
38       - lf-infra-properties:
39           build-days-to-keep: 7
40
41     parameters:
42       - lf-infra-parameters:
43           project: "{project}"
44           branch: "{branch}"
45           refspec: "refs/heads/{branch}"
46           stream: "{stream}"
47
48     wrappers:
49       - lf-infra-wrappers:
50           build-timeout: "{build-timeout}"
51           jenkins-ssh-credential: "{jenkins-ssh-credential}"
52
53     publishers:
54       - lf-infra-publish
55
56 #############
57 # RTD MERGE #
58 #############
59
60 - lf_rtd_merge: &lf_rtd_merge
61     name: lf-rtd-merge
62
63     ######################
64     # Default parameters #
65     ######################
66
67     branch: master
68     build-days-to-keep: 7
69     build-timeout: 15
70     disable-job: false
71     git-url: https://github.com
72     github-url: "https://github.com"
73     project-pattern: "**"
74     stream: master
75     submodule-recursive: true
76
77     gerrit_merge_triggers:
78       - change-merged-event
79       - comment-added-contains-event:
80           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
81
82     #####################
83     # Job Configuration #
84     #####################
85
86     disabled: "{disable-job}"
87
88     builders:
89       - lf-infra-pre-build
90       - lf-rtd-trigger-build:
91           rtd-build-url: "{rtd-build-url}"
92           rtd-token: "{rtd-token}"
93
94 - job-template:
95     name: "{project-name}-rtd-merge-{stream}"
96     id: gerrit-rtd-merge
97     <<: *lf_rtd_common
98     # yamllint disable-line rule:key-duplicates
99     <<: *lf_rtd_merge
100
101     triggers:
102       - gerrit:
103           server-name: "{gerrit-server-name}"
104           trigger-on: "{obj:gerrit_merge_triggers}"
105           projects:
106             - project-compare-type: "ANT"
107               project-pattern: "{project-pattern}"
108               branches:
109                 - branch-compare-type: "ANT"
110                   branch-pattern: "**/{branch}"
111                 - branch-compare-type: "ANT"
112                   branch-pattern: "refs/tags/**"
113               file-paths: "{obj:gerrit_trigger_file_paths}"
114
115 - job-template:
116     name: "{project-name}-rtd-merge-{stream}"
117     id: github-rtd-merge
118     <<: *lf_rtd_common
119     # yamllint disable-line rule:key-duplicates
120     <<: *lf_rtd_merge
121
122     properties:
123       - lf-infra-properties:
124           build-days-to-keep: "{build-days-to-keep}"
125       - github:
126           url: "{github-url}/{github-org}/{project}"
127
128     triggers:
129       - timed: "H H * * *"
130       - github
131       - pollscm:
132           cron: ""
133       - github-pull-request:
134           trigger-phrase: "^remerge$"
135           only-trigger-phrase: true
136           status-context: "RTD Merge"
137           permit-all: true
138           github-hooks: true
139           org-list:
140             - "{github-org}"
141           white-list: "{obj:github_pr_allowlist}"
142           admin-list: "{obj:github_pr_admin_list}"
143           included-regions: "{obj:github_included_regions}"
144           white-list-target-branches:
145             - "{branch}"
146
147 #############
148 # RTD VERIFY#
149 #############
150
151 - lf_rtd_verify: &lf_rtd_verify
152     name: lf-rtd-verify
153
154     ######################
155     # Default parameters #
156     ######################
157
158     branch: master
159     build-days-to-keep: 7
160     build-timeout: 15
161     disable-job: false
162     doc-dir: docs/_build/html
163     git-url: "$GIT_URL/$PROJECT"
164     github-url: "https://github.com"
165     project-pattern: "**"
166     python-version: python3
167     stream: master
168     submodule-recursive: true
169     submodule-timeout: 10
170     submodule-disable: false
171     gerrit-skip-vote: false
172
173     gerrit_verify_triggers:
174       - patchset-created-event:
175           exclude-drafts: true
176           exclude-trivial-rebase: false
177           exclude-no-code-change: false
178       - draft-published-event
179       - comment-added-contains-event:
180           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
181
182     #####################
183     # Job Configuration #
184     #####################
185
186     disabled: "{disable-job}"
187
188     builders:
189       - lf-infra-pre-build
190       - lf-rtd-verify:
191           doc-dir: "{doc-dir}"
192           python-version: "{python-version}"
193
194 - job-template:
195     name: "{project-name}-rtd-verify-{stream}"
196     id: gerrit-rtd-verify
197     concurrent: true
198     <<: *lf_rtd_common
199     # yamllint disable-line rule:key-duplicates
200     <<: *lf_rtd_verify
201
202     scm:
203       - lf-infra-gerrit-scm:
204           branch: "$GERRIT_BRANCH"
205           jenkins-ssh-credential: "{jenkins-ssh-credential}"
206           git-url: "{git-url}"
207           refspec: "" # Leave blank!! A later script will handle fetching
208           submodule-recursive: "{submodule-recursive}"
209           submodule-timeout: "{submodule-timeout}"
210           submodule-disable: "{submodule-disable}"
211           choosing-strategy: default
212
213     triggers:
214       - gerrit:
215           server-name: "{gerrit-server-name}"
216           trigger-on: "{obj:gerrit_verify_triggers}"
217           projects:
218             - project-compare-type: "ANT"
219               project-pattern: "{project-pattern}"
220               branches:
221                 - branch-compare-type: "ANT"
222                   branch-pattern: "**/{branch}"
223               file-paths: "{obj:gerrit_trigger_file_paths}"
224           skip-vote:
225             successful: "{gerrit-skip-vote}"
226             failed: "{gerrit-skip-vote}"
227             unstable: "{gerrit-skip-vote}"
228             notbuilt: "{gerrit-skip-vote}"
229
230 - job-template:
231     name: "{project-name}-rtd-verify-{stream}"
232     id: github-rtd-verify
233     concurrent: true
234     <<: *lf_rtd_common
235     # yamllint disable-line rule:key-duplicates
236     <<: *lf_rtd_verify
237
238     properties:
239       - lf-infra-properties:
240           build-days-to-keep: "{build-days-to-keep}"
241       - github:
242           url: "{github-url}/{github-org}/{project}"
243
244     scm:
245       - lf-infra-github-scm:
246           url: "{git-clone-url}{github-org}/{project}"
247           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
248           branch: "$sha1"
249           submodule-recursive: "{submodule-recursive}"
250           submodule-timeout: "{submodule-timeout}"
251           submodule-disable: "{submodule-disable}"
252           choosing-strategy: default
253           jenkins-ssh-credential: "{jenkins-ssh-credential}"
254
255     triggers:
256       - github-pull-request:
257           trigger-phrase: "^(recheck|reverify)$"
258           only-trigger-phrase: false
259           status-context: "RTD Verify"
260           permit-all: true
261           github-hooks: true
262           included-regions: "{obj:github_included_regions}"
263           white-list-target-branches:
264             - "{branch}"