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 white-list-target-branches:
218 included-regions: '{obj:github_included_regions}'
220 ########################
221 # Python Sonar with Tox #
222 ########################
224 - lf_tox_sonar: &lf_tox_sonar
227 ######################
228 # Default parameters #
229 ######################
231 branch: master # Sonar should always be run on master branch
232 build-days-to-keep: 7
234 cron: 'H H * * *' # run daily
235 git-url: '$GIT_URL/$PROJECT'
236 github-url: 'https://github.com'
237 java-version: openjdk8
238 python-version: python2
239 mvn-global-settings: global-settings
240 mvn-settings: '{mvn-settings}'
242 sonar-mvn-goal: 'sonar:sonar'
244 submodule-recursive: true
246 gerrit_trigger_file_paths:
247 - compare-type: REG_EXP
250 # github_included_regions MUST match gerrit_trigger_file_paths
251 github_included_regions:
254 #####################
255 # Job Configuration #
256 #####################
259 - lf-infra-parameters:
263 lftools-version: '{lftools-version}'
265 name: ARCHIVE_ARTIFACTS
266 default: '{archive-artifacts}'
267 description: Artifacts to archive to the logs server.
270 # Sets an env var for shell scripts to be able to call the dynamically
271 # installed maven without having to calculate the path themselves.
272 # yamllint disable-line rule:line-length
273 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
274 description: 'Maven selector to be used by shell scripts'
276 name: SONAR_MAVEN_GOAL
277 default: '{sonar-mvn-goal}'
279 Maven goals to pass to the Sonar call. Typically sonar:sonar
280 however to use a specific version of the sonar-maven-plugin we
281 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
284 - shell: !include-raw-escape:
285 # Workaround issue where the tox run later breaks the lftools virtualenv.
286 # Without running the install first the run in the publisher will fail
287 # due to missing lftools because it gets installed into a tox venv.
288 - ../shell/lftools-install.sh
289 - lf-infra-tox-install:
290 python-version: '{python-version}'
291 - shell: !include-raw-escape: ../shell/tox-run.sh
292 - lf-provide-maven-settings:
293 global-settings-file: '{mvn-global-settings}'
294 settings-file: '{mvn-settings}'
295 - lf-infra-tox-sonar:
296 java-version: '{java-version}'
297 mvn-settings: '{mvn-settings}'
298 mvn-version: '{mvn-version}'
304 name: lf-infra-tox-sonar
305 # Run a Sonar build with Maven
308 mvn-version: '{mvn-version}'
309 - lf-update-java-alternatives:
310 java-version: '{java-version}'
312 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
313 properties-content: SONAR_HOST_URL=$SONAR_URL
314 - shell: !include-raw-escape:
315 - ../shell/common-variables.sh
316 - ../shell/maven-sonar.sh
317 - lf-provide-maven-settings-cleanup
320 name: '{project-name}-tox-sonar'
322 <<: *lf_python_common
323 # yamllint disable-line rule:key-duplicates
326 ######################
327 # Default parameters #
328 ######################
330 gerrit_sonar_triggers:
331 - comment-added-contains-event:
332 comment-contains-value: run-sonar$
334 #####################
335 # Job Configuration #
336 #####################
339 - lf-infra-gerrit-scm:
340 jenkins-ssh-credential: '{jenkins-ssh-credential}'
342 refspec: $GERRIT_REFSPEC
343 branch: $GERRIT_BRANCH
344 submodule-recursive: '{submodule-recursive}'
345 choosing-strategy: default
348 - timed: '{obj:cron}'
350 server-name: '{gerrit-server-name}'
351 trigger-on: '{obj:gerrit_sonar_triggers}'
353 - project-compare-type: 'ANT'
354 project-pattern: '{project}'
356 - branch-compare-type: 'ANT'
357 branch-pattern: '**/{branch}'
358 file-paths: '{obj:gerrit_trigger_file_paths}'
366 name: '{project-name}-tox-sonar'
368 <<: *lf_python_common
369 # yamllint disable-line rule:key-duplicates
373 - lf-infra-properties:
374 build-days-to-keep: '{build-days-to-keep}'
376 url: '{github-url}/{github-org}/{project}'
379 - lf-infra-github-scm:
380 url: '{git-clone-url}{github-org}/{project}'
381 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
383 submodule-recursive: '{submodule-recursive}'
384 choosing-strategy: default
385 jenkins-ssh-credential: '{jenkins-ssh-credential}'
388 - github-pull-request:
389 trigger-phrase: '^run-sonar$'
390 only-trigger-phrase: false
391 status-context: 'Python Sonar'
394 white-list-target-branches:
396 included-regions: '{obj:github_included_regions}'
402 - lf_tox_verify: &lf_tox_verify
405 ######################
406 # Default parameters #
407 ######################
410 build-days-to-keep: 7
412 git-url: '$GIT_URL/$GERRIT_PROJECT'
413 github-url: 'https://github.com'
415 python-version: python2
417 submodule-recursive: true
421 gerrit_trigger_file_paths:
422 - compare-type: REG_EXP
425 # github_included_regions MUST match gerrit_trigger_file_paths
426 github_included_regions:
429 #####################
430 # Job Configuration #
431 #####################
433 project-type: freestyle
438 - lf-infra-properties:
439 build-days-to-keep: '{build-days-to-keep}'
442 - lf-infra-parameters:
446 lftools-version: '{lftools-version}'
447 - lf-infra-tox-parameters:
449 tox-envs: '{tox-envs}'
452 default: '{parallel}'
453 description: Tox test type used to configure serial or parallel testing.
457 build-timeout: '{build-timeout}'
458 jenkins-ssh-credential: '{jenkins-ssh-credential}'
461 - shell: !include-raw-escape:
462 # Workaround issue where the tox run later breaks the lftools virtualenv.
463 # Without running the install first the run in the publisher will fail
464 # due to missing lftools because it gets installed into a tox venv.
465 - ../shell/lftools-install.sh
466 - lf-infra-tox-install:
467 python-version: '{python-version}'
468 - shell: !include-raw-escape: ../shell/tox-run.sh
474 # Python projects typically use tox to run testing.
475 name: '{project-name}-tox-verify-{stream}'
476 id: gerrit-tox-verify
479 ######################
480 # Default parameters #
481 ######################
483 gerrit_verify_triggers:
484 - patchset-created-event:
486 exclude-trivial-rebase: false
487 exclude-no-code-change: false
488 - draft-published-event
489 - comment-added-contains-event:
490 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
492 #####################
493 # Job Configuration #
494 #####################
497 - lf-infra-gerrit-scm:
498 jenkins-ssh-credential: '{jenkins-ssh-credential}'
500 refspec: '$GERRIT_REFSPEC'
501 branch: '$GERRIT_BRANCH'
502 submodule-recursive: '{submodule-recursive}'
503 choosing-strategy: gerrit
507 server-name: '{gerrit-server-name}'
508 trigger-on: '{obj:gerrit_verify_triggers}'
510 - project-compare-type: ANT
511 project-pattern: '{project}'
513 - branch-compare-type: ANT
514 branch-pattern: '**/{branch}'
515 file-paths: '{obj:gerrit_trigger_file_paths}'
518 # Python projects typically use tox to run testing.
519 name: '{project-name}-tox-verify-{stream}'
520 id: github-tox-verify
524 - lf-infra-properties:
525 build-days-to-keep: '{build-days-to-keep}'
527 url: '{github-url}/{github-org}/{project}'
530 - lf-infra-github-scm:
531 url: '{git-clone-url}{github-org}/{project}'
532 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
534 submodule-recursive: '{submodule-recursive}'
535 choosing-strategy: default
536 jenkins-ssh-credential: '{jenkins-ssh-credential}'
539 - github-pull-request:
540 trigger-phrase: '^(recheck|reverify)$'
541 only-trigger-phrase: false
542 status-context: 'Tox Verify'
545 white-list-target-branches:
547 included-regions: '{obj:github_included_regions}'