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 java-version: openjdk8
97 nexus-iq-cli-version: 1.44.0-01
98 staging-profile-id: '' # Unused in this job
100 submodule-recursive: true
102 gerrit_trigger_file_paths:
106 # github_included_regions MUST match gerrit_trigger_file_paths
107 github_included_regions:
110 #####################
111 # Job Configuration #
112 #####################
115 - lf-infra-parameters:
119 lftools-version: '{lftools-version}'
121 name: NEXUS_IQ_CLI_VERSION
122 default: '{nexus-iq-cli-version}'
123 description: Nexus IQ CLI package to download and use.
126 - credentials-binding:
127 - username-password-separated:
128 credential-id: nexus-iq-xc-clm
130 password: CLM_PASSWORD
132 - lf-update-java-alternatives:
133 java-version: '{java-version}'
134 - lf-infra-clm-python:
135 clm-project-name: '{project-name}'
138 name: '{project-name}-python-clm-{stream}'
139 id: gerrit-python-xc-clm
140 <<: *lf_python_common
141 # yamllint disable-line rule:key-duplicates
142 <<: *lf_python_xc_clm
144 ######################
145 # Default parameters #
146 ######################
149 - comment-added-contains-event:
150 comment-contains-value: run-clm$
152 #####################
153 # Job Configuration #
154 #####################
157 - lf-infra-gerrit-scm:
158 jenkins-ssh-credential: '{jenkins-ssh-credential}'
160 refspec: '$GERRIT_REFSPEC'
161 branch: '$GERRIT_BRANCH'
162 submodule-recursive: '{submodule-recursive}'
163 choosing-strategy: default
166 # Build weekly on Saturdays
169 server-name: '{gerrit-server-name}'
170 trigger-on: '{obj:gerrit_clm_triggers}'
172 - project-compare-type: ANT
173 project-pattern: '{project}'
175 - branch-compare-type: ANT
176 branch-pattern: '**/{branch}'
177 file-paths: '{obj:gerrit_trigger_file_paths}'
185 name: '{project-name}-python-clm-{stream}'
186 id: github-python-xc-clm
187 <<: *lf_python_common
188 # yamllint disable-line rule:key-duplicates
189 <<: *lf_python_xc_clm
193 url: '{git-url}/{github-org}/{project}'
196 - lf-infra-github-scm:
197 url: '{git-clone-url}{github-org}/{project}'
199 branch: 'refs/heads/{branch}'
200 submodule-recursive: '{submodule-recursive}'
201 choosing-strategy: default
202 jenkins-ssh-credential: '{jenkins-ssh-credential}'
205 # Build weekly on Saturdays
207 - github-pull-request:
208 trigger-phrase: '^run-clm$'
209 only-trigger-phrase: false
210 status-context: 'CLM'
213 included-regions: '{obj:github_included_regions}'
215 ########################
216 # Python Sonar with Tox #
217 ########################
219 - lf_tox_sonar: &lf_tox_sonar
222 ######################
223 # Default parameters #
224 ######################
226 branch: master # Sonar should always be run on master branch
227 build-days-to-keep: 7
229 cron: 'H H * * *' # run daily
230 git-url: '$GIT_URL/$PROJECT'
231 java-version: openjdk8
232 python-version: python2
233 mvn-global-settings: global-settings
234 mvn-settings: '{mvn-settings}'
236 sonar-mvn-goal: 'sonar:sonar'
238 submodule-recursive: true
240 gerrit_trigger_file_paths:
241 - compare-type: REG_EXP
244 # github_included_regions MUST match gerrit_trigger_file_paths
245 github_included_regions:
248 #####################
249 # Job Configuration #
250 #####################
253 - lf-infra-parameters:
257 lftools-version: '{lftools-version}'
259 name: ARCHIVE_ARTIFACTS
260 default: '{archive-artifacts}'
261 description: Artifacts to archive to the logs server.
264 # Sets an env var for shell scripts to be able to call the dynamically
265 # installed maven without having to calculate the path themselves.
266 # yamllint disable-line rule:line-length
267 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
268 description: 'Maven selector to be used by shell scripts'
270 name: SONAR_MAVEN_GOAL
271 default: '{sonar-mvn-goal}'
273 Maven goals to pass to the Sonar call. Typically sonar:sonar
274 however to use a specific version of the sonar-maven-plugin we
275 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
278 - shell: !include-raw-escape:
279 # Workaround issue where the tox run later breaks the lftools virtualenv.
280 # Without running the install first the run in the publisher will fail
281 # due to missing lftools because it gets installed into a tox venv.
282 - ../shell/lftools-install.sh
283 - lf-infra-tox-install:
284 python-version: '{python-version}'
285 - shell: !include-raw-escape: ../shell/tox-run.sh
286 - lf-provide-maven-settings:
287 global-settings-file: '{mvn-global-settings}'
288 settings-file: '{mvn-settings}'
289 - lf-infra-tox-sonar:
290 java-version: '{java-version}'
291 mvn-settings: '{mvn-settings}'
292 mvn-version: '{mvn-version}'
298 name: lf-infra-tox-sonar
299 # Run a Sonar build with Maven
302 mvn-version: '{mvn-version}'
303 - lf-update-java-alternatives:
304 java-version: '{java-version}'
306 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
307 properties-content: SONAR_HOST_URL=$SONAR_URL
308 - shell: !include-raw-escape:
309 - ../shell/common-variables.sh
310 - ../shell/maven-sonar.sh
311 - lf-provide-maven-settings-cleanup
314 name: '{project-name}-tox-sonar'
316 <<: *lf_python_common
317 # yamllint disable-line rule:key-duplicates
320 ######################
321 # Default parameters #
322 ######################
324 gerrit_sonar_triggers:
325 - comment-added-contains-event:
326 comment-contains-value: run-sonar$
328 #####################
329 # Job Configuration #
330 #####################
333 - lf-infra-gerrit-scm:
334 jenkins-ssh-credential: '{jenkins-ssh-credential}'
336 refspec: $GERRIT_REFSPEC
337 branch: $GERRIT_BRANCH
338 submodule-recursive: '{submodule-recursive}'
339 choosing-strategy: default
342 - timed: '{obj:cron}'
344 server-name: '{gerrit-server-name}'
345 trigger-on: '{obj:gerrit_sonar_triggers}'
347 - project-compare-type: 'ANT'
348 project-pattern: '{project}'
350 - branch-compare-type: 'ANT'
351 branch-pattern: '**/{branch}'
352 file-paths: '{obj:gerrit_trigger_file_paths}'
360 name: '{project-name}-tox-sonar'
362 <<: *lf_python_common
363 # yamllint disable-line rule:key-duplicates
368 url: '{git-url}/{github-org}/{project}'
371 - lf-infra-github-scm:
372 url: '{git-clone-url}{github-org}/{project}'
373 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
375 submodule-recursive: '{submodule-recursive}'
376 choosing-strategy: default
377 jenkins-ssh-credential: '{jenkins-ssh-credential}'
380 - github-pull-request:
381 trigger-phrase: '^run-sonar$'
382 only-trigger-phrase: false
383 status-context: 'Python Sonar'
386 included-regions: '{obj:github_included_regions}'
392 - lf_tox_verify: &lf_tox_verify
395 ######################
396 # Default parameters #
397 ######################
400 build-days-to-keep: 7
402 git-url: '$GIT_URL/$GERRIT_PROJECT'
404 python-version: python2
406 submodule-recursive: true
410 gerrit_trigger_file_paths:
411 - compare-type: REG_EXP
414 # github_included_regions MUST match gerrit_trigger_file_paths
415 github_included_regions:
418 #####################
419 # Job Configuration #
420 #####################
422 project-type: freestyle
427 - lf-infra-properties:
428 build-days-to-keep: '{build-days-to-keep}'
431 - lf-infra-parameters:
435 lftools-version: '{lftools-version}'
436 - lf-infra-tox-parameters:
438 tox-envs: '{tox-envs}'
442 build-timeout: '{build-timeout}'
443 jenkins-ssh-credential: '{jenkins-ssh-credential}'
446 - shell: !include-raw-escape:
447 # Workaround issue where the tox run later breaks the lftools virtualenv.
448 # Without running the install first the run in the publisher will fail
449 # due to missing lftools because it gets installed into a tox venv.
450 - ../shell/lftools-install.sh
451 - lf-infra-tox-install:
452 python-version: '{python-version}'
453 - shell: !include-raw-escape: ../shell/tox-run.sh
459 # Python projects typically use tox to run testing.
460 name: '{project-name}-tox-verify-{stream}'
461 id: gerrit-tox-verify
464 ######################
465 # Default parameters #
466 ######################
468 gerrit_verify_triggers:
469 - patchset-created-event:
471 exclude-trivial-rebase: false
472 exclude-no-code-change: false
473 - draft-published-event
474 - comment-added-contains-event:
475 comment-contains-value: recheck$
477 #####################
478 # Job Configuration #
479 #####################
482 - lf-infra-gerrit-scm:
483 jenkins-ssh-credential: '{jenkins-ssh-credential}'
485 refspec: '$GERRIT_REFSPEC'
486 branch: '$GERRIT_BRANCH'
487 submodule-recursive: '{submodule-recursive}'
488 choosing-strategy: gerrit
493 default: '{parallel}'
494 description: Tox test type used to configure serial or parallel testing.
499 server-name: '{gerrit-server-name}'
500 trigger-on: '{obj:gerrit_verify_triggers}'
502 - project-compare-type: ANT
503 project-pattern: '{project}'
505 - branch-compare-type: ANT
506 branch-pattern: '**/{branch}'
507 file-paths: '{obj:gerrit_trigger_file_paths}'
510 # Python projects typically use tox to run testing.
511 name: '{project-name}-tox-verify-{stream}'
512 id: github-tox-verify
517 url: '{git-url}/{github-org}/{project}'
520 - lf-infra-github-scm:
521 url: '{git-clone-url}{github-org}/{project}'
522 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
524 submodule-recursive: '{submodule-recursive}'
525 choosing-strategy: default
526 jenkins-ssh-credential: '{jenkins-ssh-credential}'
529 - github-pull-request:
530 trigger-phrase: '^recheck$'
531 only-trigger-phrase: false
532 status-context: 'Tox Verify'
535 included-regions: '{obj:github_included_regions}'