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$
105 gerrit_trigger_file_paths:
109 #####################
110 # Job Configuration #
111 #####################
114 - lf-infra-parameters:
118 lftools-version: '{lftools-version}'
120 name: NEXUS_IQ_CLI_VERSION
121 default: '{nexus-iq-cli-version}'
122 description: Nexus IQ CLI package to download and use.
125 # Build weekly on Saturdays
128 server-name: '{gerrit-server-name}'
129 trigger-on: '{obj:gerrit_clm_triggers}'
131 - project-compare-type: ANT
132 project-pattern: '{project}'
134 - branch-compare-type: ANT
135 branch-pattern: '**/{branch}'
136 file-paths: '{obj:gerrit_trigger_file_paths}'
143 - credentials-binding:
144 - username-password-separated:
145 credential-id: nexus-iq-xc-clm
147 password: CLM_PASSWORD
149 - lf-update-java-alternatives:
150 java-version: '{java-version}'
151 - lf-infra-clm-python:
152 clm-project-name: '{project-name}'
155 name: '{project-name}-python-clm-{stream}'
156 id: gerrit-python-xc-clm
157 <<: *lf_python_common
158 # yamllint disable-line rule:key-duplicates
159 <<: *lf_python_xc_clm
162 - lf-infra-gerrit-scm:
163 jenkins-ssh-credential: '{jenkins-ssh-credential}'
165 refspec: '$GERRIT_REFSPEC'
166 branch: '$GERRIT_BRANCH'
167 submodule-recursive: '{submodule-recursive}'
168 choosing-strategy: default
171 name: '{project-name}-python-clm-{stream}'
172 id: github-python-xc-clm
173 <<: *lf_python_common
174 # yamllint disable-line rule:key-duplicates
175 <<: *lf_python_xc_clm
179 url: '{git-url}/{github-org}/{project}'
182 - lf-infra-github-scm:
183 url: '{git-clone-url}{github-org}/{project}'
185 branch: 'refs/heads/{branch}'
186 submodule-recursive: '{submodule-recursive}'
187 choosing-strategy: default
188 jenkins-ssh-credential: '{jenkins-ssh-credential}'
191 - lf-infra-github-pr-trigger:
192 trigger-phrase: '^run-clm$'
193 only-trigger-phrase: false
194 status-context: 'CLM'
200 github_pr_admin_list:
203 ########################
204 # Python Sonar with Tox #
205 ########################
207 - lf_tox_sonar: &lf_tox_sonar
210 ######################
211 # Default parameters #
212 ######################
214 branch: master # Sonar should always be run on master branch
215 build-days-to-keep: 7
217 cron: 'H H * * *' # run daily
218 git-url: '$GIT_URL/$PROJECT'
219 java-version: openjdk8
220 python-version: python2
221 mvn-global-settings: global-settings
222 mvn-settings: '{mvn-settings}'
224 sonar-mvn-goal: 'sonar:sonar'
226 submodule-recursive: true
228 gerrit_sonar_triggers:
229 - comment-added-contains-event:
230 comment-contains-value: run-sonar$
231 gerrit_trigger_file_paths:
235 #####################
236 # Job Configuration #
237 #####################
240 - lf-infra-parameters:
244 lftools-version: '{lftools-version}'
246 name: ARCHIVE_ARTIFACTS
247 default: '{archive-artifacts}'
248 description: Artifacts to archive to the logs server.
251 # Sets an env var for shell scripts to be able to call the dynamically
252 # installed maven without having to calculate the path themselves.
253 # yamllint disable-line rule:line-length
254 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
255 description: 'Maven selector to be used by shell scripts'
257 name: SONAR_MAVEN_GOAL
258 default: '{sonar-mvn-goal}'
260 Maven goals to pass to the Sonar call. Typically sonar:sonar
261 however to use a specific version of the sonar-maven-plugin we
262 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
265 - timed: '{obj:cron}'
267 server-name: '{gerrit-server-name}'
268 trigger-on: '{obj:gerrit_sonar_triggers}'
270 - project-compare-type: 'ANT'
271 project-pattern: '{project}'
273 - branch-compare-type: 'ANT'
274 branch-pattern: '**/master'
275 file-paths: '{obj:gerrit_trigger_file_paths}'
283 - shell: !include-raw-escape:
284 # Workaround issue where the tox run later breaks the lftools virtualenv.
285 # Without running the install first the run in the publisher will fail
286 # due to missing lftools because it gets installed into a tox venv.
287 - ../shell/lftools-install.sh
288 - lf-infra-tox-install:
289 python-version: '{python-version}'
290 - shell: !include-raw-escape: ../shell/tox-run.sh
291 - lf-provide-maven-settings:
292 global-settings-file: '{mvn-global-settings}'
293 settings-file: '{mvn-settings}'
294 - lf-infra-tox-sonar:
295 java-version: '{java-version}'
296 mvn-settings: '{mvn-settings}'
297 mvn-version: '{mvn-version}'
303 name: lf-infra-tox-sonar
304 # Run a Sonar build with Maven
307 mvn-version: '{mvn-version}'
308 - lf-update-java-alternatives:
309 java-version: '{java-version}'
311 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
312 properties-content: SONAR_HOST_URL=$SONAR_URL
313 - shell: !include-raw-escape:
314 - ../shell/common-variables.sh
315 - ../shell/maven-sonar.sh
316 - lf-provide-maven-settings-cleanup
319 name: '{project-name}-tox-sonar'
321 <<: *lf_python_common
322 # yamllint disable-line rule:key-duplicates
326 - lf-infra-gerrit-scm:
327 jenkins-ssh-credential: '{jenkins-ssh-credential}'
329 refspec: $GERRIT_REFSPEC
330 branch: $GERRIT_BRANCH
331 submodule-recursive: '{submodule-recursive}'
332 choosing-strategy: default
335 name: '{project-name}-tox-sonar'
337 <<: *lf_python_common
338 # yamllint disable-line rule:key-duplicates
343 url: '{git-url}/{github-org}/{project}'
346 - lf-infra-github-scm:
347 url: '{git-clone-url}{github-org}/{project}'
348 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
350 submodule-recursive: '{submodule-recursive}'
351 choosing-strategy: default
352 jenkins-ssh-credential: '{jenkins-ssh-credential}'
355 - lf-infra-github-pr-trigger:
356 trigger-phrase: '^run-sonar$'
357 only-trigger-phrase: false
358 status-context: 'Python Sonar'
364 github_pr_admin_list:
371 - lf_tox_verify: &lf_tox_verify
374 ######################
375 # Default parameters #
376 ######################
379 build-days-to-keep: 7
381 git-url: '$GIT_URL/$GERRIT_PROJECT'
382 python-version: python2
384 submodule-recursive: true
388 #####################
389 # Job Configuration #
390 #####################
392 project-type: freestyle
397 - lf-infra-properties:
398 build-days-to-keep: '{build-days-to-keep}'
401 - lf-infra-parameters:
405 lftools-version: '{lftools-version}'
406 - lf-infra-tox-parameters:
408 tox-envs: '{tox-envs}'
412 build-timeout: '{build-timeout}'
413 jenkins-ssh-credential: '{jenkins-ssh-credential}'
416 - shell: !include-raw-escape:
417 # Workaround issue where the tox run later breaks the lftools virtualenv.
418 # Without running the install first the run in the publisher will fail
419 # due to missing lftools because it gets installed into a tox venv.
420 - ../shell/lftools-install.sh
421 - lf-infra-tox-install:
422 python-version: '{python-version}'
423 - shell: !include-raw-escape: ../shell/tox-run.sh
429 # Python projects typically use tox to run testing.
430 name: '{project-name}-tox-verify-{stream}'
431 id: gerrit-tox-verify
434 ######################
435 # Default parameters #
436 ######################
438 gerrit_verify_triggers:
439 - patchset-created-event:
441 exclude-trivial-rebase: false
442 exclude-no-code-change: false
443 - draft-published-event
444 - comment-added-contains-event:
445 comment-contains-value: recheck$
446 gerrit_trigger_file_paths:
452 #####################
453 # Job Configuration #
454 #####################
457 - lf-infra-gerrit-scm:
458 jenkins-ssh-credential: '{jenkins-ssh-credential}'
460 refspec: '$GERRIT_REFSPEC'
461 branch: '$GERRIT_BRANCH'
462 submodule-recursive: '{submodule-recursive}'
463 choosing-strategy: gerrit
468 default: '{parallel}'
469 description: Tox test type used to configure serial or parallel testing.
474 server-name: '{gerrit-server-name}'
475 trigger-on: '{obj:gerrit_verify_triggers}'
477 - project-compare-type: ANT
478 project-pattern: '{project}'
480 - branch-compare-type: ANT
481 branch-pattern: '**/{branch}'
482 file-paths: '{obj:gerrit_trigger_file_paths}'
485 # Python projects typically use tox to run testing.
486 name: '{project-name}-tox-verify-{stream}'
487 id: github-tox-verify
492 url: '{git-url}/{github-org}/{project}'
495 - lf-infra-github-scm:
496 url: '{git-clone-url}{github-org}/{project}'
497 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
499 submodule-recursive: '{submodule-recursive}'
500 choosing-strategy: default
501 jenkins-ssh-credential: '{jenkins-ssh-credential}'
504 - github-pull-request:
505 trigger-phrase: '^recheck$'
506 only-trigger-phrase: false
507 status-context: 'JJB Verify'
510 auto-close-on-fail: false