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 ######################
54 nexus-iq-cli-version: 1.44.0-01
60 project-type: freestyle
64 - lf-infra-properties:
65 build-days-to-keep: '{build-days-to-keep}'
68 - lf-infra-parameters:
72 lftools-version: '{lftools-version}'
76 build-timeout: '{build-timeout}'
77 jenkins-ssh-credential: '{jenkins-ssh-credential}'
86 - lf_python_clm_xc: &lf_python_xc_clm
87 name: lf-python-xc-clm
89 ######################
90 # Default parameters #
91 ######################
94 build-days-to-keep: 30 # 30 days for troubleshooting purposes
96 git-url: '$GIT_URL/$PROJECT'
97 java-version: openjdk8
98 staging-profile-id: '' # Unused in this job
100 submodule-recursive: true
103 - comment-added-contains-event:
104 comment-contains-value: run-clm$
106 #####################
107 # Job Configuration #
108 #####################
112 name: NEXUS_IQ_CLI_VERSION
113 default: '{nexus-iq-cli-version}'
114 description: Nexus IQ CLI package to download and use.
117 # Build weekly on Saturdays
120 server-name: '{gerrit-server-name}'
121 trigger-on: '{obj:gerrit_clm_triggers}'
123 - project-compare-type: ANT
124 project-pattern: '{project}'
126 - branch-compare-type: ANT
127 branch-pattern: '**/{branch}'
134 - credentials-binding:
135 - username-password-separated:
136 credential-id: nexus-iq-xc-clm
138 password: CLM_PASSWORD
140 - lf-update-java-alternatives:
141 java-version: '{java-version}'
142 - lf-infra-clm-python:
143 clm-project-name: '{project-name}'
146 name: '{project-name}-python-clm-{stream}'
147 id: gerrit-python-xc-clm
148 <<: *lf_python_common
149 # yamllint disable-line rule:key-duplicates
150 <<: *lf_python_xc_clm
153 - lf-infra-gerrit-scm:
154 jenkins-ssh-credential: '{jenkins-ssh-credential}'
156 refspec: '$GERRIT_REFSPEC'
157 branch: '$GERRIT_BRANCH'
158 submodule-recursive: '{submodule-recursive}'
159 choosing-strategy: default
162 name: '{project-name}-python-clm-{stream}'
163 id: github-python-xc-clm
164 <<: *lf_python_common
165 # yamllint disable-line rule:key-duplicates
166 <<: *lf_python_xc_clm
170 url: '{git-url}/{github-org}/{project}'
173 - lf-infra-github-scm:
174 url: '{git-clone-url}{github-org}/{project}'
176 branch: 'refs/heads/{branch}'
177 submodule-recursive: '{submodule-recursive}'
178 choosing-strategy: default
179 jenkins-ssh-credential: '{jenkins-ssh-credential}'
182 - lf-infra-github-pr-trigger:
183 trigger-phrase: '^run-clm$'
184 only-trigger-phrase: false
185 status-context: 'CLM'
191 github_pr_admin_list:
194 ########################
195 # Python Sonar with Tox #
196 ########################
198 - lf_tox_sonar: &lf_tox_sonar
201 ######################
202 # Default parameters #
203 ######################
205 branch: master # Sonar should always be run on master branch
206 build-days-to-keep: 7
208 cron: 'H H * * *' # run daily
209 git-url: '$GIT_URL/$PROJECT'
210 java-version: openjdk8
211 python-version: python2
212 mvn-global-settings: global-settings
213 mvn-settings: '{mvn-settings}'
215 sonar-mvn-goal: 'sonar:sonar'
217 submodule-recursive: true
219 gerrit_sonar_triggers:
220 - comment-added-contains-event:
221 comment-contains-value: run-sonar$
223 #####################
224 # Job Configuration #
225 #####################
228 - lf-infra-parameters:
232 lftools-version: '{lftools-version}'
234 name: ARCHIVE_ARTIFACTS
235 default: '{archive-artifacts}'
236 description: Artifacts to archive to the logs server.
239 # Sets an env var for shell scripts to be able to call the dynamically
240 # installed maven without having to calculate the path themselves.
241 # yamllint disable-line rule:line-length
242 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
243 description: 'Maven selector to be used by shell scripts'
245 name: SONAR_MAVEN_GOAL
246 default: '{sonar-mvn-goal}'
248 Maven goals to pass to the Sonar call. Typically sonar:sonar
249 however to use a specific version of the sonar-maven-plugin we
250 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
253 - timed: '{obj:cron}'
255 server-name: '{gerrit-server-name}'
256 trigger-on: '{obj:gerrit_sonar_triggers}'
258 - project-compare-type: 'ANT'
259 project-pattern: '{project}'
261 - branch-compare-type: 'ANT'
262 branch-pattern: '**/master'
270 - shell: !include-raw-escape:
271 # Workaround issue where the tox run later breaks the lftools virtualenv.
272 # Without running the install first the run in the publisher will fail
273 # due to missing lftools because it gets installed into a tox venv.
274 - ../shell/lftools-install.sh
275 - lf-infra-tox-install:
276 python-version: '{python-version}'
277 - shell: !include-raw-escape: ../shell/tox-run.sh
278 - lf-provide-maven-settings:
279 global-settings-file: '{mvn-global-settings}'
280 settings-file: '{mvn-settings}'
281 - lf-infra-tox-sonar:
282 java-version: '{java-version}'
283 mvn-settings: '{mvn-settings}'
284 mvn-version: '{mvn-version}'
290 name: lf-infra-tox-sonar
291 # Run a Sonar build with Maven
294 mvn-version: '{mvn-version}'
295 - lf-update-java-alternatives:
296 java-version: '{java-version}'
298 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
299 properties-content: SONAR_HOST_URL=$SONAR_URL
300 - shell: !include-raw-escape:
301 - ../shell/common-variables.sh
302 - ../shell/maven-sonar.sh
303 - lf-provide-maven-settings-cleanup
306 name: '{project-name}-tox-sonar'
308 <<: *lf_python_common
309 # yamllint disable-line rule:key-duplicates
313 - lf-infra-gerrit-scm:
314 jenkins-ssh-credential: '{jenkins-ssh-credential}'
316 refspec: $GERRIT_REFSPEC
317 branch: $GERRIT_BRANCH
318 submodule-recursive: '{submodule-recursive}'
319 choosing-strategy: default
322 name: '{project-name}-tox-sonar'
324 <<: *lf_python_common
325 # yamllint disable-line rule:key-duplicates
330 url: '{git-url}/{github-org}/{project}'
333 - lf-infra-github-scm:
334 url: '{git-clone-url}{github-org}/{project}'
335 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
337 submodule-recursive: '{submodule-recursive}'
338 choosing-strategy: default
339 jenkins-ssh-credential: '{jenkins-ssh-credential}'
342 - lf-infra-github-pr-trigger:
343 trigger-phrase: '^run-sonar$'
344 only-trigger-phrase: false
345 status-context: 'Python Sonar'
351 github_pr_admin_list:
358 - lf_tox_verify: &lf_tox_verify
361 ######################
362 # Default parameters #
363 ######################
366 build-days-to-keep: 7
368 git-url: '$GIT_URL/$GERRIT_PROJECT'
369 python-version: python2
371 submodule-recursive: true
375 #####################
376 # Job Configuration #
377 #####################
379 project-type: freestyle
384 - lf-infra-properties:
385 build-days-to-keep: '{build-days-to-keep}'
388 - lf-infra-parameters:
392 lftools-version: '{lftools-version}'
393 - lf-infra-tox-parameters:
395 tox-envs: '{tox-envs}'
399 build-timeout: '{build-timeout}'
400 jenkins-ssh-credential: '{jenkins-ssh-credential}'
403 - shell: !include-raw-escape:
404 # Workaround issue where the tox run later breaks the lftools virtualenv.
405 # Without running the install first the run in the publisher will fail
406 # due to missing lftools because it gets installed into a tox venv.
407 - ../shell/lftools-install.sh
408 - lf-infra-tox-install:
409 python-version: '{python-version}'
410 - shell: !include-raw-escape: ../shell/tox-run.sh
416 # Python projects typically use tox to run testing.
417 name: '{project-name}-tox-verify-{stream}'
418 id: gerrit-tox-verify
421 ######################
422 # Default parameters #
423 ######################
425 gerrit_verify_triggers:
426 - patchset-created-event:
428 exclude-trivial-rebase: false
429 exclude-no-code-change: false
430 - draft-published-event
431 - comment-added-contains-event:
432 comment-contains-value: recheck$
436 #####################
437 # Job Configuration #
438 #####################
441 - lf-infra-gerrit-scm:
442 jenkins-ssh-credential: '{jenkins-ssh-credential}'
444 refspec: '$GERRIT_REFSPEC'
445 branch: '$GERRIT_BRANCH'
446 submodule-recursive: '{submodule-recursive}'
447 choosing-strategy: gerrit
452 default: '{parallel}'
453 description: Tox test type used to configure serial or parallel testing.
458 server-name: '{gerrit-server-name}'
459 trigger-on: '{obj:gerrit_verify_triggers}'
461 - project-compare-type: ANT
462 project-pattern: '{project}'
464 - branch-compare-type: ANT
465 branch-pattern: '**/{branch}'
468 # Python projects typically use tox to run testing.
469 name: '{project-name}-tox-verify-{stream}'
470 id: github-tox-verify
475 url: '{git-url}/{github-org}/{project}'
478 - lf-infra-github-scm:
479 url: '{git-clone-url}{github-org}/{project}'
480 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
482 submodule-recursive: '{submodule-recursive}'
483 choosing-strategy: default
484 jenkins-ssh-credential: '{jenkins-ssh-credential}'
487 - github-pull-request:
488 trigger-phrase: '^recheck$'
489 only-trigger-phrase: false
490 status-context: 'JJB Verify'
493 auto-close-on-fail: false