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
96 git-url: '$GIT_URL/$PROJECT'
97 github-url: 'https://github.com'
98 java-version: openjdk8
99 nexus-iq-cli-version: 1.44.0-01
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 #####################
115 disabled: '{disable-job}'
118 - lf-infra-parameters:
122 lftools-version: '{lftools-version}'
124 name: NEXUS_IQ_CLI_VERSION
125 default: '{nexus-iq-cli-version}'
126 description: Nexus IQ CLI package to download and use.
129 - credentials-binding:
130 - username-password-separated:
131 credential-id: nexus-iq-xc-clm
133 password: CLM_PASSWORD
135 - lf-update-java-alternatives:
136 java-version: '{java-version}'
137 - lf-infra-clm-python:
138 clm-project-name: '{project-name}'
141 name: '{project-name}-python-clm-{stream}'
142 id: gerrit-python-xc-clm
143 <<: *lf_python_common
144 # yamllint disable-line rule:key-duplicates
145 <<: *lf_python_xc_clm
147 ######################
148 # Default parameters #
149 ######################
152 - comment-added-contains-event:
153 comment-contains-value: run-clm$
155 #####################
156 # Job Configuration #
157 #####################
160 - lf-infra-gerrit-scm:
161 jenkins-ssh-credential: '{jenkins-ssh-credential}'
163 refspec: '$GERRIT_REFSPEC'
164 branch: '$GERRIT_BRANCH'
165 submodule-recursive: '{submodule-recursive}'
166 choosing-strategy: default
169 # Build weekly on Saturdays
172 server-name: '{gerrit-server-name}'
173 trigger-on: '{obj:gerrit_clm_triggers}'
175 - project-compare-type: ANT
176 project-pattern: '{project}'
178 - branch-compare-type: ANT
179 branch-pattern: '**/{branch}'
180 file-paths: '{obj:gerrit_trigger_file_paths}'
188 name: '{project-name}-python-clm-{stream}'
189 id: github-python-xc-clm
190 <<: *lf_python_common
191 # yamllint disable-line rule:key-duplicates
192 <<: *lf_python_xc_clm
195 - lf-infra-properties:
196 build-days-to-keep: '{build-days-to-keep}'
198 url: '{github-url}/{github-org}/{project}'
201 - lf-infra-github-scm:
202 url: '{git-clone-url}{github-org}/{project}'
204 branch: 'refs/heads/{branch}'
205 submodule-recursive: '{submodule-recursive}'
206 choosing-strategy: default
207 jenkins-ssh-credential: '{jenkins-ssh-credential}'
210 # Build weekly on Saturdays
212 - github-pull-request:
213 trigger-phrase: '^run-clm$'
214 only-trigger-phrase: false
215 status-context: 'CLM'
218 white-list-target-branches:
220 included-regions: '{obj:github_included_regions}'
222 ########################
223 # Python Sonar with Tox #
224 ########################
226 - lf_tox_sonar: &lf_tox_sonar
229 ######################
230 # Default parameters #
231 ######################
233 branch: master # Sonar should always be run on master branch
234 build-days-to-keep: 7
236 cron: 'H H * * *' # run daily
238 git-url: '$GIT_URL/$PROJECT'
239 github-url: 'https://github.com'
240 java-version: openjdk8
241 python-version: python2
242 mvn-global-settings: global-settings
243 mvn-settings: '{mvn-settings}'
245 sonar-mvn-goal: 'sonar:sonar'
247 submodule-recursive: true
249 gerrit_trigger_file_paths:
250 - compare-type: REG_EXP
253 # github_included_regions MUST match gerrit_trigger_file_paths
254 github_included_regions:
257 #####################
258 # Job Configuration #
259 #####################
261 disabled: '{disable-job}'
264 - lf-infra-parameters:
268 lftools-version: '{lftools-version}'
270 name: ARCHIVE_ARTIFACTS
271 default: '{archive-artifacts}'
272 description: Artifacts to archive to the logs server.
275 # Sets an env var for shell scripts to be able to call the dynamically
276 # installed maven without having to calculate the path themselves.
277 # yamllint disable-line rule:line-length
278 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
279 description: 'Maven selector to be used by shell scripts'
281 name: SONAR_MAVEN_GOAL
282 default: '{sonar-mvn-goal}'
284 Maven goals to pass to the Sonar call. Typically sonar:sonar
285 however to use a specific version of the sonar-maven-plugin we
286 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
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
414 git-url: '$GIT_URL/$GERRIT_PROJECT'
415 github-url: 'https://github.com'
417 python-version: python2
419 submodule-recursive: true
423 gerrit_trigger_file_paths:
424 - compare-type: REG_EXP
427 # github_included_regions MUST match gerrit_trigger_file_paths
428 github_included_regions:
431 #####################
432 # Job Configuration #
433 #####################
435 project-type: freestyle
438 disabled: '{disable-job}'
441 - lf-infra-properties:
442 build-days-to-keep: '{build-days-to-keep}'
445 - lf-infra-parameters:
449 lftools-version: '{lftools-version}'
450 - lf-infra-tox-parameters:
452 tox-envs: '{tox-envs}'
455 default: '{parallel}'
456 description: Tox test type used to configure serial or parallel testing.
460 build-timeout: '{build-timeout}'
461 jenkins-ssh-credential: '{jenkins-ssh-credential}'
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}'