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
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
192 - lf-infra-properties:
193 build-days-to-keep: '{build-days-to-keep}'
195 url: '{github-url}/{github-org}/{project}'
198 - lf-infra-github-scm:
199 url: '{git-clone-url}{github-org}/{project}'
201 branch: 'refs/heads/{branch}'
202 submodule-recursive: '{submodule-recursive}'
203 choosing-strategy: default
204 jenkins-ssh-credential: '{jenkins-ssh-credential}'
207 # Build weekly on Saturdays
209 - github-pull-request:
210 trigger-phrase: '^run-clm$'
211 only-trigger-phrase: false
212 status-context: 'CLM'
215 white-list-target-branches:
217 included-regions: '{obj:github_included_regions}'
219 ########################
220 # Python Sonar with Tox #
221 ########################
223 - lf_tox_sonar: &lf_tox_sonar
226 ######################
227 # Default parameters #
228 ######################
230 branch: master # Sonar should always be run on master branch
231 build-days-to-keep: 7
233 cron: 'H H * * *' # run daily
234 git-url: '$GIT_URL/$PROJECT'
235 github-url: 'https://github.com'
236 java-version: openjdk8
237 python-version: python2
238 mvn-global-settings: global-settings
239 mvn-settings: '{mvn-settings}'
241 sonar-mvn-goal: 'sonar:sonar'
243 submodule-recursive: true
245 gerrit_trigger_file_paths:
246 - compare-type: REG_EXP
249 # github_included_regions MUST match gerrit_trigger_file_paths
250 github_included_regions:
253 #####################
254 # Job Configuration #
255 #####################
258 - lf-infra-parameters:
262 lftools-version: '{lftools-version}'
264 name: ARCHIVE_ARTIFACTS
265 default: '{archive-artifacts}'
266 description: Artifacts to archive to the logs server.
269 # Sets an env var for shell scripts to be able to call the dynamically
270 # installed maven without having to calculate the path themselves.
271 # yamllint disable-line rule:line-length
272 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
273 description: 'Maven selector to be used by shell scripts'
275 name: SONAR_MAVEN_GOAL
276 default: '{sonar-mvn-goal}'
278 Maven goals to pass to the Sonar call. Typically sonar:sonar
279 however to use a specific version of the sonar-maven-plugin we
280 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
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
325 ######################
326 # Default parameters #
327 ######################
329 gerrit_sonar_triggers:
330 - comment-added-contains-event:
331 comment-contains-value: run-sonar$
333 #####################
334 # Job Configuration #
335 #####################
338 - lf-infra-gerrit-scm:
339 jenkins-ssh-credential: '{jenkins-ssh-credential}'
341 refspec: $GERRIT_REFSPEC
342 branch: $GERRIT_BRANCH
343 submodule-recursive: '{submodule-recursive}'
344 choosing-strategy: default
347 - timed: '{obj:cron}'
349 server-name: '{gerrit-server-name}'
350 trigger-on: '{obj:gerrit_sonar_triggers}'
352 - project-compare-type: 'ANT'
353 project-pattern: '{project}'
355 - branch-compare-type: 'ANT'
356 branch-pattern: '**/{branch}'
357 file-paths: '{obj:gerrit_trigger_file_paths}'
365 name: '{project-name}-tox-sonar'
367 <<: *lf_python_common
368 # yamllint disable-line rule:key-duplicates
372 - lf-infra-properties:
373 build-days-to-keep: '{build-days-to-keep}'
375 url: '{github-url}/{github-org}/{project}'
378 - lf-infra-github-scm:
379 url: '{git-clone-url}{github-org}/{project}'
380 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
382 submodule-recursive: '{submodule-recursive}'
383 choosing-strategy: default
384 jenkins-ssh-credential: '{jenkins-ssh-credential}'
387 - github-pull-request:
388 trigger-phrase: '^run-sonar$'
389 only-trigger-phrase: false
390 status-context: 'Python Sonar'
393 white-list-target-branches:
395 included-regions: '{obj:github_included_regions}'
401 - lf_tox_verify: &lf_tox_verify
404 ######################
405 # Default parameters #
406 ######################
409 build-days-to-keep: 7
411 git-url: '$GIT_URL/$GERRIT_PROJECT'
412 github-url: 'https://github.com'
414 python-version: python2
416 submodule-recursive: true
420 gerrit_trigger_file_paths:
421 - compare-type: REG_EXP
424 # github_included_regions MUST match gerrit_trigger_file_paths
425 github_included_regions:
428 #####################
429 # Job Configuration #
430 #####################
432 project-type: freestyle
437 - lf-infra-properties:
438 build-days-to-keep: '{build-days-to-keep}'
441 - lf-infra-parameters:
445 lftools-version: '{lftools-version}'
446 - lf-infra-tox-parameters:
448 tox-envs: '{tox-envs}'
451 default: '{parallel}'
452 description: Tox test type used to configure serial or parallel testing.
456 build-timeout: '{build-timeout}'
457 jenkins-ssh-credential: '{jenkins-ssh-credential}'
460 - shell: !include-raw-escape:
461 # Workaround issue where the tox run later breaks the lftools virtualenv.
462 # Without running the install first the run in the publisher will fail
463 # due to missing lftools because it gets installed into a tox venv.
464 - ../shell/lftools-install.sh
465 - lf-infra-tox-install:
466 python-version: '{python-version}'
467 - shell: !include-raw-escape: ../shell/tox-run.sh
473 # Python projects typically use tox to run testing.
474 name: '{project-name}-tox-verify-{stream}'
475 id: gerrit-tox-verify
478 ######################
479 # Default parameters #
480 ######################
482 gerrit_verify_triggers:
483 - patchset-created-event:
485 exclude-trivial-rebase: false
486 exclude-no-code-change: false
487 - draft-published-event
488 - comment-added-contains-event:
489 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
491 #####################
492 # Job Configuration #
493 #####################
496 - lf-infra-gerrit-scm:
497 jenkins-ssh-credential: '{jenkins-ssh-credential}'
499 refspec: '$GERRIT_REFSPEC'
500 branch: '$GERRIT_BRANCH'
501 submodule-recursive: '{submodule-recursive}'
502 choosing-strategy: gerrit
506 server-name: '{gerrit-server-name}'
507 trigger-on: '{obj:gerrit_verify_triggers}'
509 - project-compare-type: ANT
510 project-pattern: '{project}'
512 - branch-compare-type: ANT
513 branch-pattern: '**/{branch}'
514 file-paths: '{obj:gerrit_trigger_file_paths}'
517 # Python projects typically use tox to run testing.
518 name: '{project-name}-tox-verify-{stream}'
519 id: github-tox-verify
523 - lf-infra-properties:
524 build-days-to-keep: '{build-days-to-keep}'
526 url: '{github-url}/{github-org}/{project}'
529 - lf-infra-github-scm:
530 url: '{git-clone-url}{github-org}/{project}'
531 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
533 submodule-recursive: '{submodule-recursive}'
534 choosing-strategy: default
535 jenkins-ssh-credential: '{jenkins-ssh-credential}'
538 - github-pull-request:
539 trigger-phrase: '^(recheck|reverify)$'
540 only-trigger-phrase: false
541 status-context: 'Tox Verify'
544 white-list-target-branches:
546 included-regions: '{obj:github_included_regions}'