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
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
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
194 - lf-infra-properties:
195 build-days-to-keep: '{build-days-to-keep}'
197 url: '{github-url}/{github-org}/{project}'
200 - lf-infra-github-scm:
201 url: '{git-clone-url}{github-org}/{project}'
203 branch: 'refs/heads/{branch}'
204 submodule-recursive: '{submodule-recursive}'
205 choosing-strategy: default
206 jenkins-ssh-credential: '{jenkins-ssh-credential}'
209 # Build weekly on Saturdays
211 - github-pull-request:
212 trigger-phrase: '^run-clm$'
213 only-trigger-phrase: false
214 status-context: 'CLM'
217 white-list-target-branches:
219 included-regions: '{obj:github_included_regions}'
221 ########################
222 # Python Sonar with Tox #
223 ########################
225 - lf_tox_sonar: &lf_tox_sonar
228 ######################
229 # Default parameters #
230 ######################
232 branch: master # Sonar should always be run on master branch
233 build-days-to-keep: 7
235 cron: 'H H * * *' # run daily
236 git-url: '$GIT_URL/$PROJECT'
237 github-url: 'https://github.com'
238 java-version: openjdk8
239 python-version: python2
240 mvn-global-settings: global-settings
241 mvn-settings: '{mvn-settings}'
243 sonar-mvn-goal: 'sonar:sonar'
245 submodule-recursive: true
247 gerrit_trigger_file_paths:
248 - compare-type: REG_EXP
251 # github_included_regions MUST match gerrit_trigger_file_paths
252 github_included_regions:
255 #####################
256 # Job Configuration #
257 #####################
260 - lf-infra-parameters:
264 lftools-version: '{lftools-version}'
266 name: ARCHIVE_ARTIFACTS
267 default: '{archive-artifacts}'
268 description: Artifacts to archive to the logs server.
271 # Sets an env var for shell scripts to be able to call the dynamically
272 # installed maven without having to calculate the path themselves.
273 # yamllint disable-line rule:line-length
274 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
275 description: 'Maven selector to be used by shell scripts'
277 name: SONAR_MAVEN_GOAL
278 default: '{sonar-mvn-goal}'
280 Maven goals to pass to the Sonar call. Typically sonar:sonar
281 however to use a specific version of the sonar-maven-plugin we
282 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
285 - shell: !include-raw-escape:
286 # Workaround issue where the tox run later breaks the lftools virtualenv.
287 # Without running the install first the run in the publisher will fail
288 # due to missing lftools because it gets installed into a tox venv.
289 - ../shell/lftools-install.sh
290 - lf-infra-tox-install:
291 python-version: '{python-version}'
292 - shell: !include-raw-escape: ../shell/tox-run.sh
293 - lf-provide-maven-settings:
294 global-settings-file: '{mvn-global-settings}'
295 settings-file: '{mvn-settings}'
296 - lf-infra-tox-sonar:
297 java-version: '{java-version}'
298 mvn-settings: '{mvn-settings}'
299 mvn-version: '{mvn-version}'
305 name: lf-infra-tox-sonar
306 # Run a Sonar build with Maven
309 mvn-version: '{mvn-version}'
310 - lf-update-java-alternatives:
311 java-version: '{java-version}'
313 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
314 properties-content: SONAR_HOST_URL=$SONAR_URL
315 - shell: !include-raw-escape:
316 - ../shell/common-variables.sh
317 - ../shell/maven-sonar.sh
318 - lf-provide-maven-settings-cleanup
321 name: '{project-name}-tox-sonar'
323 <<: *lf_python_common
324 # yamllint disable-line rule:key-duplicates
327 ######################
328 # Default parameters #
329 ######################
331 gerrit_sonar_triggers:
332 - comment-added-contains-event:
333 comment-contains-value: run-sonar$
335 #####################
336 # Job Configuration #
337 #####################
340 - lf-infra-gerrit-scm:
341 jenkins-ssh-credential: '{jenkins-ssh-credential}'
343 refspec: $GERRIT_REFSPEC
344 branch: $GERRIT_BRANCH
345 submodule-recursive: '{submodule-recursive}'
346 choosing-strategy: default
349 - timed: '{obj:cron}'
351 server-name: '{gerrit-server-name}'
352 trigger-on: '{obj:gerrit_sonar_triggers}'
354 - project-compare-type: 'ANT'
355 project-pattern: '{project}'
357 - branch-compare-type: 'ANT'
358 branch-pattern: '**/{branch}'
359 file-paths: '{obj:gerrit_trigger_file_paths}'
367 name: '{project-name}-tox-sonar'
369 <<: *lf_python_common
370 # yamllint disable-line rule:key-duplicates
374 - lf-infra-properties:
375 build-days-to-keep: '{build-days-to-keep}'
377 url: '{github-url}/{github-org}/{project}'
380 - lf-infra-github-scm:
381 url: '{git-clone-url}{github-org}/{project}'
382 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
384 submodule-recursive: '{submodule-recursive}'
385 choosing-strategy: default
386 jenkins-ssh-credential: '{jenkins-ssh-credential}'
389 - github-pull-request:
390 trigger-phrase: '^run-sonar$'
391 only-trigger-phrase: false
392 status-context: 'Python Sonar'
395 white-list-target-branches:
397 included-regions: '{obj:github_included_regions}'
403 - lf_tox_verify: &lf_tox_verify
406 ######################
407 # Default parameters #
408 ######################
411 build-days-to-keep: 7
413 git-url: '$GIT_URL/$GERRIT_PROJECT'
414 github-url: 'https://github.com'
416 python-version: python2
418 submodule-recursive: true
422 gerrit_trigger_file_paths:
423 - compare-type: REG_EXP
426 # github_included_regions MUST match gerrit_trigger_file_paths
427 github_included_regions:
430 #####################
431 # Job Configuration #
432 #####################
434 project-type: freestyle
439 - lf-infra-properties:
440 build-days-to-keep: '{build-days-to-keep}'
443 - lf-infra-parameters:
447 lftools-version: '{lftools-version}'
448 - lf-infra-tox-parameters:
450 tox-envs: '{tox-envs}'
453 default: '{parallel}'
454 description: Tox test type used to configure serial or parallel testing.
458 build-timeout: '{build-timeout}'
459 jenkins-ssh-credential: '{jenkins-ssh-credential}'
462 - shell: !include-raw-escape:
463 # Workaround issue where the tox run later breaks the lftools virtualenv.
464 # Without running the install first the run in the publisher will fail
465 # due to missing lftools because it gets installed into a tox venv.
466 - ../shell/lftools-install.sh
467 - lf-infra-tox-install:
468 python-version: '{python-version}'
469 - shell: !include-raw-escape: ../shell/tox-run.sh
475 # Python projects typically use tox to run testing.
476 name: '{project-name}-tox-verify-{stream}'
477 id: gerrit-tox-verify
480 ######################
481 # Default parameters #
482 ######################
484 gerrit_verify_triggers:
485 - patchset-created-event:
487 exclude-trivial-rebase: false
488 exclude-no-code-change: false
489 - draft-published-event
490 - comment-added-contains-event:
491 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
493 #####################
494 # Job Configuration #
495 #####################
498 - lf-infra-gerrit-scm:
499 jenkins-ssh-credential: '{jenkins-ssh-credential}'
501 refspec: '$GERRIT_REFSPEC'
502 branch: '$GERRIT_BRANCH'
503 submodule-recursive: '{submodule-recursive}'
504 choosing-strategy: gerrit
508 server-name: '{gerrit-server-name}'
509 trigger-on: '{obj:gerrit_verify_triggers}'
511 - project-compare-type: ANT
512 project-pattern: '{project}'
514 - branch-compare-type: ANT
515 branch-pattern: '**/{branch}'
516 file-paths: '{obj:gerrit_trigger_file_paths}'
519 # Python projects typically use tox to run testing.
520 name: '{project-name}-tox-verify-{stream}'
521 id: github-tox-verify
525 - lf-infra-properties:
526 build-days-to-keep: '{build-days-to-keep}'
528 url: '{github-url}/{github-org}/{project}'
531 - lf-infra-github-scm:
532 url: '{git-clone-url}{github-org}/{project}'
533 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
535 submodule-recursive: '{submodule-recursive}'
536 choosing-strategy: default
537 jenkins-ssh-credential: '{jenkins-ssh-credential}'
540 - github-pull-request:
541 trigger-phrase: '^(recheck|reverify)$'
542 only-trigger-phrase: false
543 status-context: 'Tox Verify'
546 white-list-target-branches:
548 included-regions: '{obj:github_included_regions}'