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".
289 - shell: !include-raw-escape:
290 # Workaround issue where the tox run later breaks the lftools virtualenv.
291 # Without running the install first the run in the publisher will fail
292 # due to missing lftools because it gets installed into a tox venv.
293 - ../shell/lftools-install.sh
294 - lf-infra-tox-install:
295 python-version: '{python-version}'
296 - shell: !include-raw-escape: ../shell/tox-run.sh
297 - lf-provide-maven-settings:
298 global-settings-file: '{mvn-global-settings}'
299 settings-file: '{mvn-settings}'
300 - lf-infra-tox-sonar:
301 java-version: '{java-version}'
302 mvn-settings: '{mvn-settings}'
303 mvn-version: '{mvn-version}'
309 name: lf-infra-tox-sonar
310 # Run a Sonar build with Maven
313 mvn-version: '{mvn-version}'
314 - lf-update-java-alternatives:
315 java-version: '{java-version}'
317 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
318 properties-content: SONAR_HOST_URL=$SONAR_URL
319 - shell: !include-raw-escape:
320 - ../shell/common-variables.sh
321 - ../shell/maven-sonar.sh
322 - lf-provide-maven-settings-cleanup
325 name: '{project-name}-tox-sonar'
327 <<: *lf_python_common
328 # yamllint disable-line rule:key-duplicates
331 ######################
332 # Default parameters #
333 ######################
335 gerrit_sonar_triggers:
336 - comment-added-contains-event:
337 comment-contains-value: run-sonar$
339 #####################
340 # Job Configuration #
341 #####################
344 - lf-infra-gerrit-scm:
345 jenkins-ssh-credential: '{jenkins-ssh-credential}'
347 refspec: $GERRIT_REFSPEC
348 branch: $GERRIT_BRANCH
349 submodule-recursive: '{submodule-recursive}'
350 choosing-strategy: default
353 - timed: '{obj:cron}'
355 server-name: '{gerrit-server-name}'
356 trigger-on: '{obj:gerrit_sonar_triggers}'
358 - project-compare-type: 'ANT'
359 project-pattern: '{project}'
361 - branch-compare-type: 'ANT'
362 branch-pattern: '**/{branch}'
363 file-paths: '{obj:gerrit_trigger_file_paths}'
371 name: '{project-name}-tox-sonar'
373 <<: *lf_python_common
374 # yamllint disable-line rule:key-duplicates
378 - lf-infra-properties:
379 build-days-to-keep: '{build-days-to-keep}'
381 url: '{github-url}/{github-org}/{project}'
384 - lf-infra-github-scm:
385 url: '{git-clone-url}{github-org}/{project}'
386 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
388 submodule-recursive: '{submodule-recursive}'
389 choosing-strategy: default
390 jenkins-ssh-credential: '{jenkins-ssh-credential}'
393 - github-pull-request:
394 trigger-phrase: '^run-sonar$'
395 only-trigger-phrase: false
396 status-context: 'Python Sonar'
399 white-list-target-branches:
401 included-regions: '{obj:github_included_regions}'
407 - lf_tox_verify: &lf_tox_verify
410 ######################
411 # Default parameters #
412 ######################
415 build-days-to-keep: 7
418 git-url: '$GIT_URL/$GERRIT_PROJECT'
419 github-url: 'https://github.com'
421 python-version: python2
423 submodule-recursive: true
427 gerrit_trigger_file_paths:
428 - compare-type: REG_EXP
431 # github_included_regions MUST match gerrit_trigger_file_paths
432 github_included_regions:
435 #####################
436 # Job Configuration #
437 #####################
439 project-type: freestyle
442 disabled: '{disable-job}'
445 - lf-infra-properties:
446 build-days-to-keep: '{build-days-to-keep}'
449 - lf-infra-parameters:
453 lftools-version: '{lftools-version}'
454 - lf-infra-tox-parameters:
456 tox-envs: '{tox-envs}'
459 default: '{parallel}'
460 description: Tox test type used to configure serial or parallel testing.
464 build-timeout: '{build-timeout}'
465 jenkins-ssh-credential: '{jenkins-ssh-credential}'
469 - lf-infra-tox-install:
470 python-version: '{python-version}'
471 - shell: !include-raw-escape: ../shell/tox-run.sh
477 # Python projects typically use tox to run testing.
478 name: '{project-name}-tox-verify-{stream}'
479 id: gerrit-tox-verify
482 ######################
483 # Default parameters #
484 ######################
486 gerrit_verify_triggers:
487 - patchset-created-event:
489 exclude-trivial-rebase: false
490 exclude-no-code-change: false
491 - draft-published-event
492 - comment-added-contains-event:
493 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
495 #####################
496 # Job Configuration #
497 #####################
500 - lf-infra-gerrit-scm:
501 jenkins-ssh-credential: '{jenkins-ssh-credential}'
503 refspec: '$GERRIT_REFSPEC'
504 branch: '$GERRIT_BRANCH'
505 submodule-recursive: '{submodule-recursive}'
506 choosing-strategy: gerrit
510 server-name: '{gerrit-server-name}'
511 trigger-on: '{obj:gerrit_verify_triggers}'
513 - project-compare-type: ANT
514 project-pattern: '{project}'
516 - branch-compare-type: ANT
517 branch-pattern: '**/{branch}'
518 file-paths: '{obj:gerrit_trigger_file_paths}'
521 # Python projects typically use tox to run testing.
522 name: '{project-name}-tox-verify-{stream}'
523 id: github-tox-verify
527 - lf-infra-properties:
528 build-days-to-keep: '{build-days-to-keep}'
530 url: '{github-url}/{github-org}/{project}'
533 - lf-infra-github-scm:
534 url: '{git-clone-url}{github-org}/{project}'
535 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
537 submodule-recursive: '{submodule-recursive}'
538 choosing-strategy: default
539 jenkins-ssh-credential: '{jenkins-ssh-credential}'
542 - github-pull-request:
543 trigger-phrase: '^(recheck|reverify)$'
544 only-trigger-phrase: false
545 status-context: 'Tox Verify'
548 white-list-target-branches:
550 included-regions: '{obj:github_included_regions}'