Update RTD to use Generic API v2 webhook
[releng/global-jjb.git] / jjb / lf-python-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-python-jobs'
4
5     # This job group contains all the recommended jobs that should be deployed
6     # for any project ci that is using Gerrit.
7
8     jobs:
9       - gerrit-python-xc-clm
10       - gerrit-tox-verify
11
12 - job-group:
13     name: '{project-name}-github-python-jobs'
14
15     # This job group contains all the recommended jobs that should be deployed
16     # for any project ci that is using GitHub.
17
18     jobs:
19       - github-python-xc-clm
20       - github-tox-verify
21
22 ##########
23 # Macros #
24 ##########
25
26 - builder:
27     name: lf-infra-tox-install
28     builders:
29       - inject:
30           properties-content: 'PYTHON_VERSION={python-version}'
31       - shell: !include-raw-escape: ../shell/tox-install.sh
32
33 - builder:
34     name: lf-infra-clm-python
35     builders:
36       - inject:
37           properties-content: 'CLM_PROJECT_NAME={clm-project-name}'
38       - shell: !include-raw-escape:
39           - ../shell/sonar-cli.sh
40
41 ####################
42 # COMMON FUNCTIONS #
43 ####################
44
45 - lf_python_common: &lf_python_common
46     name: lf-python-common
47
48     ######################
49     # Default parameters #
50     ######################
51
52     archive-artifacts: >
53       **/*.log
54       **/hs_err_*.log
55       **/target/**/feature.xml
56       **/target/failsafe-reports/failsafe-summary.xml
57       **/target/surefire-reports/*-output.txt
58
59     #####################
60     # Job Configuration #
61     #####################
62
63     project-type: freestyle
64     node: '{build-node}'
65
66     properties:
67       - lf-infra-properties:
68           build-days-to-keep: '{build-days-to-keep}'
69
70     parameters:
71       - lf-infra-parameters:
72           project: '{project}'
73           branch: '{branch}'
74           stream: '{stream}'
75           lftools-version: '{lftools-version}'
76       - string:
77           name: NEXUS_IQ_CLI_JAR
78           default: nexus-iq-cli-1.44.0-01.jar
79           description: Nexus IQ CLI package to download and use.
80       - string:
81           name: ARCHIVE_ARTIFACTS
82           default: '{archive-artifacts}'
83           description: Artifacts to archive to the logs server.
84
85     wrappers:
86       - lf-infra-wrappers:
87           build-timeout: '{build-timeout}'
88           jenkins-ssh-credential: '{jenkins-ssh-credential}'
89
90     publishers:
91       - lf-infra-publish
92
93 #################
94 # Python XC CLM #
95 #################
96
97 - lf_python_clm_xc: &lf_python_xc_clm
98     name: lf-python-xc-clm
99
100     ######################
101     # Default parameters #
102     ######################
103
104     branch: master
105     build-days-to-keep: 30  # 30 days for troubleshooting purposes
106     build-timeout: 60
107     git-url: '$GIT_URL/$PROJECT'
108     java-version: openjdk8
109     staging-profile-id: ''  # Unused in this job
110     stream: master
111     submodule-recursive: true
112
113     gerrit_clm_triggers:
114       - comment-added-contains-event:
115           comment-contains-value: run-xc-clm$
116
117     #####################
118     # Job Configuration #
119     #####################
120
121     triggers:
122       # Build weekly on Saturdays
123       - timed: 'H H * * 6'
124       - gerrit:
125           server-name: '{gerrit-server-name}'
126           trigger-on: '{obj:gerrit_clm_triggers}'
127           projects:
128             - project-compare-type: ANT
129               project-pattern: '{project}'
130               branches:
131                 - branch-compare-type: ANT
132                   branch-pattern: '**/{branch}'
133           skip-vote:
134             successful: true
135             failed: true
136             unstable: true
137             notbuilt: true
138     wrappers:
139       - credentials-binding:
140           - username-password-separated:
141               credential-id: sonar-xc-clm
142               username: CLM_USER
143               password: CLM_PASSWORD
144     builders:
145       - lf-update-java-alternatives:
146           java-version: '{java-version}'
147       - lf-infra-clm-python:
148           clm-project-name: '{project-name}'
149
150 - job-template:
151     name: '{project-name}-python-clm-{stream}'
152     id: gerrit-python-xc-clm
153     <<: *lf_python_common
154     # yamllint disable-line rule:key-duplicates
155     <<: *lf_python_xc_clm
156
157     scm:
158       - lf-infra-gerrit-scm:
159           jenkins-ssh-credential: '{jenkins-ssh-credential}'
160           git-url: '{git-url}'
161           refspec: '$GERRIT_REFSPEC'
162           branch: '$GERRIT_BRANCH'
163           submodule-recursive: '{submodule-recursive}'
164           choosing-strategy: default
165
166 - job-template:
167     name: '{project-name}-python-clm-{stream}'
168     id: github-python-xc-clm
169     <<: *lf_python_common
170     # yamllint disable-line rule:key-duplicates
171     <<: *lf_python_xc_clm
172
173     properties:
174       - github:
175           url: '{git-url}/{github-org}/{project}'
176
177     scm:
178       - lf-infra-github-scm:
179           url: '{git-clone-url}{github-org}/{project}'
180           refspec: ''
181           branch: 'refs/heads/{branch}'
182           submodule-recursive: '{submodule-recursive}'
183           choosing-strategy: default
184           jenkins-ssh-credential: '{jenkins-ssh-credential}'
185
186     triggers:
187       - lf-infra-github-pr-trigger:
188           trigger-phrase: '^run-xc-clm$'
189           only-trigger-phrase: false
190           status-context: 'CLM'
191           permit-all: true
192           github-hooks: true
193           github-org: ''
194           github_pr_whitelist:
195             - ''
196           github_pr_admin_list:
197             - ''
198
199 ##############
200 # Tox Verify #
201 ##############
202
203 - lf_tox_verify: &lf_tox_verify
204     name: lf-tox-verify
205
206     ######################
207     # Default parameters #
208     ######################
209
210     branch: master
211     build-days-to-keep: 7
212     build-timeout: 15
213     git-url: '$GIT_URL/$GERRIT_PROJECT'
214     python-version: python2
215     stream: master
216     submodule-recursive: true
217     tox-dir: ''
218     tox-envs: ''
219
220     #####################
221     # Job Configuration #
222     #####################
223
224     project-type: freestyle
225     node: '{build-node}'
226     concurrent: true
227
228     properties:
229       - lf-infra-properties:
230           build-days-to-keep: '{build-days-to-keep}'
231
232     parameters:
233       - lf-infra-parameters:
234           project: '{project}'
235           branch: '{branch}'
236           stream: '{stream}'
237           lftools-version: '{lftools-version}'
238       - lf-infra-tox-parameters:
239           tox-dir: '{tox-dir}'
240           tox-envs: '{tox-envs}'
241
242     wrappers:
243       - lf-infra-wrappers:
244           build-timeout: '{build-timeout}'
245           jenkins-ssh-credential: '{jenkins-ssh-credential}'
246
247     builders:
248       - shell: !include-raw-escape:
249           # Workaround issue where the tox run later breaks the lftools virtualenv.
250           # Without running the install first the run in the publisher will fail
251           # due to missing lftools because it gets installed into a tox venv.
252           - ../shell/lftools-install.sh
253       - lf-infra-tox-install:
254           python-version: '{python-version}'
255       - shell: !include-raw-escape: ../shell/tox-run.sh
256
257     publishers:
258       - lf-infra-publish
259
260 - job-template:
261     # Python projects typically use tox to run testing.
262     name: '{project-name}-tox-verify-{stream}'
263     id: gerrit-tox-verify
264     <<: *lf_tox_verify
265
266     ######################
267     # Default parameters #
268     ######################
269
270     gerrit_verify_triggers:
271       - patchset-created-event:
272           exclude-drafts: true
273           exclude-trivial-rebase: false
274           exclude-no-code-change: false
275       - draft-published-event
276       - comment-added-contains-event:
277           comment-contains-value: recheck$
278
279     #####################
280     # Job Configuration #
281     #####################
282
283     scm:
284       - lf-infra-gerrit-scm:
285           jenkins-ssh-credential: '{jenkins-ssh-credential}'
286           git-url: '{git-url}'
287           refspec: '$GERRIT_REFSPEC'
288           branch: '$GERRIT_BRANCH'
289           submodule-recursive: '{submodule-recursive}'
290           choosing-strategy: gerrit
291
292     triggers:
293       - gerrit:
294           server-name: '{gerrit-server-name}'
295           trigger-on: '{obj:gerrit_verify_triggers}'
296           projects:
297             - project-compare-type: ANT
298               project-pattern: '{project}'
299               branches:
300                 - branch-compare-type: ANT
301                   branch-pattern: '**/{branch}'
302
303 - job-template:
304     # Python projects typically use tox to run testing.
305     name: '{project-name}-tox-verify-{stream}'
306     id: github-tox-verify
307     <<: *lf_tox_verify
308
309     properties:
310       - github:
311           url: '{git-url}/{github-org}/{project}'
312
313     scm:
314       - lf-infra-github-scm:
315           url: '{git-clone-url}{github-org}/{project}'
316           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
317           branch: '$sha1'
318           submodule-recursive: '{submodule-recursive}'
319           choosing-strategy: default
320           jenkins-ssh-credential: '{jenkins-ssh-credential}'
321
322     triggers:
323       - github-pull-request:
324           trigger-phrase: '^recheck$'
325           only-trigger-phrase: false
326           status-context: 'JJB Verify'
327           permit-all: true
328           github-hooks: true
329           auto-close-on-fail: false