3 name: '{project-name}-python-jobs'
5 # This job group contains all the recommended jobs that should be deployed
6 # for any project ci that is using Gerrit.
13 name: '{project-name}-github-python-jobs'
15 # This job group contains all the recommended jobs that should be deployed
16 # for any project ci that is using GitHub.
19 - github-python-xc-clm
27 name: lf-infra-tox-install
30 properties-content: 'PYTHON_VERSION={python-version}'
31 - shell: !include-raw-escape: ../shell/tox-install.sh
34 name: lf-infra-clm-python
37 properties-content: 'CLM_PROJECT_NAME={clm-project-name}'
38 - shell: !include-raw-escape:
39 - ../shell/nexus-iq-cli.sh
45 - lf_python_common: &lf_python_common
46 name: lf-python-common
48 ######################
49 # Default parameters #
50 ######################
59 project-type: freestyle
63 - lf-infra-properties:
64 build-days-to-keep: '{build-days-to-keep}'
67 - lf-infra-parameters:
71 lftools-version: '{lftools-version}'
75 build-timeout: '{build-timeout}'
76 jenkins-ssh-credential: '{jenkins-ssh-credential}'
85 - lf_python_clm_xc: &lf_python_xc_clm
86 name: lf-python-xc-clm
88 ######################
89 # Default parameters #
90 ######################
93 build-days-to-keep: 30 # 30 days for troubleshooting purposes
95 git-url: '$GIT_URL/$PROJECT'
96 github-url: 'https://github.com'
97 java-version: openjdk8
98 nexus-iq-cli-version: 1.44.0-01
99 staging-profile-id: '' # Unused in this job
101 submodule-recursive: true
103 gerrit_trigger_file_paths:
107 # github_included_regions MUST match gerrit_trigger_file_paths
108 github_included_regions:
111 #####################
112 # Job Configuration #
113 #####################
116 - lf-infra-parameters:
120 lftools-version: '{lftools-version}'
122 name: NEXUS_IQ_CLI_VERSION
123 default: '{nexus-iq-cli-version}'
124 description: Nexus IQ CLI package to download and use.
127 - credentials-binding:
128 - username-password-separated:
129 credential-id: nexus-iq-xc-clm
131 password: CLM_PASSWORD
133 - lf-update-java-alternatives:
134 java-version: '{java-version}'
135 - lf-infra-clm-python:
136 clm-project-name: '{project-name}'
139 name: '{project-name}-python-clm-{stream}'
140 id: gerrit-python-xc-clm
141 <<: *lf_python_common
142 # yamllint disable-line rule:key-duplicates
143 <<: *lf_python_xc_clm
145 ######################
146 # Default parameters #
147 ######################
150 - comment-added-contains-event:
151 comment-contains-value: run-clm$
153 #####################
154 # Job Configuration #
155 #####################
158 - lf-infra-gerrit-scm:
159 jenkins-ssh-credential: '{jenkins-ssh-credential}'
161 refspec: '$GERRIT_REFSPEC'
162 branch: '$GERRIT_BRANCH'
163 submodule-recursive: '{submodule-recursive}'
164 choosing-strategy: default
167 # Build weekly on Saturdays
170 server-name: '{gerrit-server-name}'
171 trigger-on: '{obj:gerrit_clm_triggers}'
173 - project-compare-type: ANT
174 project-pattern: '{project}'
176 - branch-compare-type: ANT
177 branch-pattern: '**/{branch}'
178 file-paths: '{obj:gerrit_trigger_file_paths}'
186 name: '{project-name}-python-clm-{stream}'
187 id: github-python-xc-clm
188 <<: *lf_python_common
189 # yamllint disable-line rule:key-duplicates
190 <<: *lf_python_xc_clm
193 - lf-infra-properties:
194 build-days-to-keep: '{build-days-to-keep}'
196 url: '{github-url}/{github-org}/{project}'
199 - lf-infra-github-scm:
200 url: '{git-clone-url}{github-org}/{project}'
202 branch: 'refs/heads/{branch}'
203 submodule-recursive: '{submodule-recursive}'
204 choosing-strategy: default
205 jenkins-ssh-credential: '{jenkins-ssh-credential}'
208 # Build weekly on Saturdays
210 - github-pull-request:
211 trigger-phrase: '^run-clm$'
212 only-trigger-phrase: false
213 status-context: 'CLM'
216 included-regions: '{obj:github_included_regions}'
218 ########################
219 # Python Sonar with Tox #
220 ########################
222 - lf_tox_sonar: &lf_tox_sonar
225 ######################
226 # Default parameters #
227 ######################
229 branch: master # Sonar should always be run on master branch
230 build-days-to-keep: 7
232 cron: 'H H * * *' # run daily
233 git-url: '$GIT_URL/$PROJECT'
234 github-url: 'https://github.com'
235 java-version: openjdk8
236 python-version: python2
237 mvn-global-settings: global-settings
238 mvn-settings: '{mvn-settings}'
240 sonar-mvn-goal: 'sonar:sonar'
242 submodule-recursive: true
244 gerrit_trigger_file_paths:
245 - compare-type: REG_EXP
248 # github_included_regions MUST match gerrit_trigger_file_paths
249 github_included_regions:
252 #####################
253 # Job Configuration #
254 #####################
257 - lf-infra-parameters:
261 lftools-version: '{lftools-version}'
263 name: ARCHIVE_ARTIFACTS
264 default: '{archive-artifacts}'
265 description: Artifacts to archive to the logs server.
268 # Sets an env var for shell scripts to be able to call the dynamically
269 # installed maven without having to calculate the path themselves.
270 # yamllint disable-line rule:line-length
271 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
272 description: 'Maven selector to be used by shell scripts'
274 name: SONAR_MAVEN_GOAL
275 default: '{sonar-mvn-goal}'
277 Maven goals to pass to the Sonar call. Typically sonar:sonar
278 however to use a specific version of the sonar-maven-plugin we
279 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
282 - shell: !include-raw-escape:
283 # Workaround issue where the tox run later breaks the lftools virtualenv.
284 # Without running the install first the run in the publisher will fail
285 # due to missing lftools because it gets installed into a tox venv.
286 - ../shell/lftools-install.sh
287 - lf-infra-tox-install:
288 python-version: '{python-version}'
289 - shell: !include-raw-escape: ../shell/tox-run.sh
290 - lf-provide-maven-settings:
291 global-settings-file: '{mvn-global-settings}'
292 settings-file: '{mvn-settings}'
293 - lf-infra-tox-sonar:
294 java-version: '{java-version}'
295 mvn-settings: '{mvn-settings}'
296 mvn-version: '{mvn-version}'
302 name: lf-infra-tox-sonar
303 # Run a Sonar build with Maven
306 mvn-version: '{mvn-version}'
307 - lf-update-java-alternatives:
308 java-version: '{java-version}'
310 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
311 properties-content: SONAR_HOST_URL=$SONAR_URL
312 - shell: !include-raw-escape:
313 - ../shell/common-variables.sh
314 - ../shell/maven-sonar.sh
315 - lf-provide-maven-settings-cleanup
318 name: '{project-name}-tox-sonar'
320 <<: *lf_python_common
321 # yamllint disable-line rule:key-duplicates
324 ######################
325 # Default parameters #
326 ######################
328 gerrit_sonar_triggers:
329 - comment-added-contains-event:
330 comment-contains-value: run-sonar$
332 #####################
333 # Job Configuration #
334 #####################
337 - lf-infra-gerrit-scm:
338 jenkins-ssh-credential: '{jenkins-ssh-credential}'
340 refspec: $GERRIT_REFSPEC
341 branch: $GERRIT_BRANCH
342 submodule-recursive: '{submodule-recursive}'
343 choosing-strategy: default
346 - timed: '{obj:cron}'
348 server-name: '{gerrit-server-name}'
349 trigger-on: '{obj:gerrit_sonar_triggers}'
351 - project-compare-type: 'ANT'
352 project-pattern: '{project}'
354 - branch-compare-type: 'ANT'
355 branch-pattern: '**/{branch}'
356 file-paths: '{obj:gerrit_trigger_file_paths}'
364 name: '{project-name}-tox-sonar'
366 <<: *lf_python_common
367 # yamllint disable-line rule:key-duplicates
371 - lf-infra-properties:
372 build-days-to-keep: '{build-days-to-keep}'
374 url: '{github-url}/{github-org}/{project}'
377 - lf-infra-github-scm:
378 url: '{git-clone-url}{github-org}/{project}'
379 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
381 submodule-recursive: '{submodule-recursive}'
382 choosing-strategy: default
383 jenkins-ssh-credential: '{jenkins-ssh-credential}'
386 - github-pull-request:
387 trigger-phrase: '^run-sonar$'
388 only-trigger-phrase: false
389 status-context: 'Python Sonar'
392 included-regions: '{obj:github_included_regions}'
398 - lf_tox_verify: &lf_tox_verify
401 ######################
402 # Default parameters #
403 ######################
406 build-days-to-keep: 7
408 git-url: '$GIT_URL/$GERRIT_PROJECT'
409 github-url: 'https://github.com'
411 python-version: python2
413 submodule-recursive: true
417 gerrit_trigger_file_paths:
418 - compare-type: REG_EXP
421 # github_included_regions MUST match gerrit_trigger_file_paths
422 github_included_regions:
425 #####################
426 # Job Configuration #
427 #####################
429 project-type: freestyle
434 - lf-infra-properties:
435 build-days-to-keep: '{build-days-to-keep}'
438 - lf-infra-parameters:
442 lftools-version: '{lftools-version}'
443 - lf-infra-tox-parameters:
445 tox-envs: '{tox-envs}'
448 default: '{parallel}'
449 description: Tox test type used to configure serial or parallel testing.
453 build-timeout: '{build-timeout}'
454 jenkins-ssh-credential: '{jenkins-ssh-credential}'
457 - shell: !include-raw-escape:
458 # Workaround issue where the tox run later breaks the lftools virtualenv.
459 # Without running the install first the run in the publisher will fail
460 # due to missing lftools because it gets installed into a tox venv.
461 - ../shell/lftools-install.sh
462 - lf-infra-tox-install:
463 python-version: '{python-version}'
464 - shell: !include-raw-escape: ../shell/tox-run.sh
470 # Python projects typically use tox to run testing.
471 name: '{project-name}-tox-verify-{stream}'
472 id: gerrit-tox-verify
475 ######################
476 # Default parameters #
477 ######################
479 gerrit_verify_triggers:
480 - patchset-created-event:
482 exclude-trivial-rebase: false
483 exclude-no-code-change: false
484 - draft-published-event
485 - comment-added-contains-event:
486 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
488 #####################
489 # Job Configuration #
490 #####################
493 - lf-infra-gerrit-scm:
494 jenkins-ssh-credential: '{jenkins-ssh-credential}'
496 refspec: '$GERRIT_REFSPEC'
497 branch: '$GERRIT_BRANCH'
498 submodule-recursive: '{submodule-recursive}'
499 choosing-strategy: gerrit
503 server-name: '{gerrit-server-name}'
504 trigger-on: '{obj:gerrit_verify_triggers}'
506 - project-compare-type: ANT
507 project-pattern: '{project}'
509 - branch-compare-type: ANT
510 branch-pattern: '**/{branch}'
511 file-paths: '{obj:gerrit_trigger_file_paths}'
514 # Python projects typically use tox to run testing.
515 name: '{project-name}-tox-verify-{stream}'
516 id: github-tox-verify
520 - lf-infra-properties:
521 build-days-to-keep: '{build-days-to-keep}'
523 url: '{github-url}/{github-org}/{project}'
526 - lf-infra-github-scm:
527 url: '{git-clone-url}{github-org}/{project}'
528 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
530 submodule-recursive: '{submodule-recursive}'
531 choosing-strategy: default
532 jenkins-ssh-credential: '{jenkins-ssh-credential}'
535 - github-pull-request:
536 trigger-phrase: '^(recheck|reverify)$'
537 only-trigger-phrase: false
538 status-context: 'Tox Verify'
541 included-regions: '{obj:github_included_regions}'