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
146 ######################
147 # Default parameters #
148 ######################
151 - comment-added-contains-event:
152 comment-contains-value: run-clm$
154 #####################
155 # Job Configuration #
156 #####################
159 - lf-infra-gerrit-scm:
160 jenkins-ssh-credential: '{jenkins-ssh-credential}'
162 refspec: '$GERRIT_REFSPEC'
163 branch: '$GERRIT_BRANCH'
164 submodule-recursive: '{submodule-recursive}'
165 choosing-strategy: default
168 # Build weekly on Saturdays
171 server-name: '{gerrit-server-name}'
172 trigger-on: '{obj:gerrit_clm_triggers}'
174 - project-compare-type: ANT
175 project-pattern: '{project}'
177 - branch-compare-type: ANT
178 branch-pattern: '**/{branch}'
179 file-paths: '{obj:gerrit_trigger_file_paths}'
187 name: '{project-name}-python-clm-{stream}'
188 id: github-python-xc-clm
189 <<: *lf_python_common
190 # yamllint disable-line rule:key-duplicates
191 <<: *lf_python_xc_clm
195 - lf-infra-properties:
196 build-days-to-keep: '{build-days-to-keep}'
198 url: '{github-url}/{github-org}/{project}'
201 - lf-infra-github-scm:
202 url: '{git-clone-url}{github-org}/{project}'
204 branch: 'refs/heads/{branch}'
205 submodule-recursive: '{submodule-recursive}'
206 choosing-strategy: default
207 jenkins-ssh-credential: '{jenkins-ssh-credential}'
210 # Build weekly on Saturdays
212 - github-pull-request:
213 trigger-phrase: '^run-clm$'
214 only-trigger-phrase: false
215 status-context: 'CLM'
218 white-list-target-branches:
220 included-regions: '{obj:github_included_regions}'
222 ########################
223 # Python Sonar with Tox #
224 ########################
226 - lf_tox_sonar: &lf_tox_sonar
229 ######################
230 # Default parameters #
231 ######################
233 branch: master # Sonar should always be run on master branch
234 build-days-to-keep: 7
236 cron: 'H H * * *' # run daily
237 git-url: '$GIT_URL/$PROJECT'
238 github-url: 'https://github.com'
239 java-version: openjdk8
240 python-version: python2
241 mvn-global-settings: global-settings
242 mvn-settings: '{mvn-settings}'
244 sonar-mvn-goal: 'sonar:sonar'
246 submodule-recursive: true
248 gerrit_trigger_file_paths:
249 - compare-type: REG_EXP
252 # github_included_regions MUST match gerrit_trigger_file_paths
253 github_included_regions:
256 #####################
257 # Job Configuration #
258 #####################
261 - lf-infra-parameters:
265 lftools-version: '{lftools-version}'
267 name: ARCHIVE_ARTIFACTS
268 default: '{archive-artifacts}'
269 description: Artifacts to archive to the logs server.
272 # Sets an env var for shell scripts to be able to call the dynamically
273 # installed maven without having to calculate the path themselves.
274 # yamllint disable-line rule:line-length
275 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
276 description: 'Maven selector to be used by shell scripts'
278 name: SONAR_MAVEN_GOAL
279 default: '{sonar-mvn-goal}'
281 Maven goals to pass to the Sonar call. Typically sonar:sonar
282 however to use a specific version of the sonar-maven-plugin we
283 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
286 - shell: !include-raw-escape:
287 # Workaround issue where the tox run later breaks the lftools virtualenv.
288 # Without running the install first the run in the publisher will fail
289 # due to missing lftools because it gets installed into a tox venv.
290 - ../shell/lftools-install.sh
291 - lf-infra-tox-install:
292 python-version: '{python-version}'
293 - shell: !include-raw-escape: ../shell/tox-run.sh
294 - lf-provide-maven-settings:
295 global-settings-file: '{mvn-global-settings}'
296 settings-file: '{mvn-settings}'
297 - lf-infra-tox-sonar:
298 java-version: '{java-version}'
299 mvn-settings: '{mvn-settings}'
300 mvn-version: '{mvn-version}'
306 name: lf-infra-tox-sonar
307 # Run a Sonar build with Maven
310 mvn-version: '{mvn-version}'
311 - lf-update-java-alternatives:
312 java-version: '{java-version}'
314 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
315 properties-content: SONAR_HOST_URL=$SONAR_URL
316 - shell: !include-raw-escape:
317 - ../shell/common-variables.sh
318 - ../shell/maven-sonar.sh
319 - lf-provide-maven-settings-cleanup
322 name: '{project-name}-tox-sonar'
324 <<: *lf_python_common
325 # yamllint disable-line rule:key-duplicates
328 ######################
329 # Default parameters #
330 ######################
332 gerrit_sonar_triggers:
333 - comment-added-contains-event:
334 comment-contains-value: run-sonar$
336 #####################
337 # Job Configuration #
338 #####################
341 - lf-infra-gerrit-scm:
342 jenkins-ssh-credential: '{jenkins-ssh-credential}'
344 refspec: $GERRIT_REFSPEC
345 branch: $GERRIT_BRANCH
346 submodule-recursive: '{submodule-recursive}'
347 choosing-strategy: default
350 - timed: '{obj:cron}'
352 server-name: '{gerrit-server-name}'
353 trigger-on: '{obj:gerrit_sonar_triggers}'
355 - project-compare-type: 'ANT'
356 project-pattern: '{project}'
358 - branch-compare-type: 'ANT'
359 branch-pattern: '**/{branch}'
360 file-paths: '{obj:gerrit_trigger_file_paths}'
368 name: '{project-name}-tox-sonar'
370 <<: *lf_python_common
371 # yamllint disable-line rule:key-duplicates
375 - lf-infra-properties:
376 build-days-to-keep: '{build-days-to-keep}'
378 url: '{github-url}/{github-org}/{project}'
381 - lf-infra-github-scm:
382 url: '{git-clone-url}{github-org}/{project}'
383 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
385 submodule-recursive: '{submodule-recursive}'
386 choosing-strategy: default
387 jenkins-ssh-credential: '{jenkins-ssh-credential}'
390 - github-pull-request:
391 trigger-phrase: '^run-sonar$'
392 only-trigger-phrase: false
393 status-context: 'Python Sonar'
396 white-list-target-branches:
398 included-regions: '{obj:github_included_regions}'
404 - lf_tox_verify: &lf_tox_verify
407 ######################
408 # Default parameters #
409 ######################
412 build-days-to-keep: 7
414 git-url: '$GIT_URL/$GERRIT_PROJECT'
415 github-url: 'https://github.com'
417 python-version: python2
419 submodule-recursive: true
423 gerrit_trigger_file_paths:
424 - compare-type: REG_EXP
427 # github_included_regions MUST match gerrit_trigger_file_paths
428 github_included_regions:
431 #####################
432 # Job Configuration #
433 #####################
435 project-type: freestyle
440 - lf-infra-properties:
441 build-days-to-keep: '{build-days-to-keep}'
444 - lf-infra-parameters:
448 lftools-version: '{lftools-version}'
449 - lf-infra-tox-parameters:
451 tox-envs: '{tox-envs}'
454 default: '{parallel}'
455 description: Tox test type used to configure serial or parallel testing.
459 build-timeout: '{build-timeout}'
460 jenkins-ssh-credential: '{jenkins-ssh-credential}'
463 - shell: !include-raw-escape:
464 # Workaround issue where the tox run later breaks the lftools virtualenv.
465 # Without running the install first the run in the publisher will fail
466 # due to missing lftools because it gets installed into a tox venv.
467 - ../shell/lftools-install.sh
468 - lf-infra-tox-install:
469 python-version: '{python-version}'
470 - shell: !include-raw-escape: ../shell/tox-run.sh
476 # Python projects typically use tox to run testing.
477 name: '{project-name}-tox-verify-{stream}'
478 id: gerrit-tox-verify
481 ######################
482 # Default parameters #
483 ######################
485 gerrit_verify_triggers:
486 - patchset-created-event:
488 exclude-trivial-rebase: false
489 exclude-no-code-change: false
490 - draft-published-event
491 - comment-added-contains-event:
492 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
494 #####################
495 # Job Configuration #
496 #####################
499 - lf-infra-gerrit-scm:
500 jenkins-ssh-credential: '{jenkins-ssh-credential}'
502 refspec: '$GERRIT_REFSPEC'
503 branch: '$GERRIT_BRANCH'
504 submodule-recursive: '{submodule-recursive}'
505 choosing-strategy: gerrit
509 server-name: '{gerrit-server-name}'
510 trigger-on: '{obj:gerrit_verify_triggers}'
512 - project-compare-type: ANT
513 project-pattern: '{project}'
515 - branch-compare-type: ANT
516 branch-pattern: '**/{branch}'
517 file-paths: '{obj:gerrit_trigger_file_paths}'
520 # Python projects typically use tox to run testing.
521 name: '{project-name}-tox-verify-{stream}'
522 id: github-tox-verify
526 - lf-infra-properties:
527 build-days-to-keep: '{build-days-to-keep}'
529 url: '{github-url}/{github-org}/{project}'
532 - lf-infra-github-scm:
533 url: '{git-clone-url}{github-org}/{project}'
534 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
536 submodule-recursive: '{submodule-recursive}'
537 choosing-strategy: default
538 jenkins-ssh-credential: '{jenkins-ssh-credential}'
541 - github-pull-request:
542 trigger-phrase: '^(recheck|reverify)$'
543 only-trigger-phrase: false
544 status-context: 'Tox Verify'
547 white-list-target-branches:
549 included-regions: '{obj:github_included_regions}'