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 java-version: openjdk8
97 nexus-iq-cli-version: 1.44.0-01
98 staging-profile-id: '' # Unused in this job
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: '{git-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 included-regions: '{obj:github_included_regions}'
217 ########################
218 # Python Sonar with Tox #
219 ########################
221 - lf_tox_sonar: &lf_tox_sonar
224 ######################
225 # Default parameters #
226 ######################
228 branch: master # Sonar should always be run on master branch
229 build-days-to-keep: 7
231 cron: 'H H * * *' # run daily
232 git-url: '$GIT_URL/$PROJECT'
233 java-version: openjdk8
234 python-version: python2
235 mvn-global-settings: global-settings
236 mvn-settings: '{mvn-settings}'
238 sonar-mvn-goal: 'sonar:sonar'
240 submodule-recursive: true
242 gerrit_trigger_file_paths:
243 - compare-type: REG_EXP
246 # github_included_regions MUST match gerrit_trigger_file_paths
247 github_included_regions:
250 #####################
251 # Job Configuration #
252 #####################
255 - lf-infra-parameters:
259 lftools-version: '{lftools-version}'
261 name: ARCHIVE_ARTIFACTS
262 default: '{archive-artifacts}'
263 description: Artifacts to archive to the logs server.
266 # Sets an env var for shell scripts to be able to call the dynamically
267 # installed maven without having to calculate the path themselves.
268 # yamllint disable-line rule:line-length
269 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
270 description: 'Maven selector to be used by shell scripts'
272 name: SONAR_MAVEN_GOAL
273 default: '{sonar-mvn-goal}'
275 Maven goals to pass to the Sonar call. Typically sonar:sonar
276 however to use a specific version of the sonar-maven-plugin we
277 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
280 - shell: !include-raw-escape:
281 # Workaround issue where the tox run later breaks the lftools virtualenv.
282 # Without running the install first the run in the publisher will fail
283 # due to missing lftools because it gets installed into a tox venv.
284 - ../shell/lftools-install.sh
285 - lf-infra-tox-install:
286 python-version: '{python-version}'
287 - shell: !include-raw-escape: ../shell/tox-run.sh
288 - lf-provide-maven-settings:
289 global-settings-file: '{mvn-global-settings}'
290 settings-file: '{mvn-settings}'
291 - lf-infra-tox-sonar:
292 java-version: '{java-version}'
293 mvn-settings: '{mvn-settings}'
294 mvn-version: '{mvn-version}'
300 name: lf-infra-tox-sonar
301 # Run a Sonar build with Maven
304 mvn-version: '{mvn-version}'
305 - lf-update-java-alternatives:
306 java-version: '{java-version}'
308 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
309 properties-content: SONAR_HOST_URL=$SONAR_URL
310 - shell: !include-raw-escape:
311 - ../shell/common-variables.sh
312 - ../shell/maven-sonar.sh
313 - lf-provide-maven-settings-cleanup
316 name: '{project-name}-tox-sonar'
318 <<: *lf_python_common
319 # yamllint disable-line rule:key-duplicates
322 ######################
323 # Default parameters #
324 ######################
326 gerrit_sonar_triggers:
327 - comment-added-contains-event:
328 comment-contains-value: run-sonar$
330 #####################
331 # Job Configuration #
332 #####################
335 - lf-infra-gerrit-scm:
336 jenkins-ssh-credential: '{jenkins-ssh-credential}'
338 refspec: $GERRIT_REFSPEC
339 branch: $GERRIT_BRANCH
340 submodule-recursive: '{submodule-recursive}'
341 choosing-strategy: default
344 - timed: '{obj:cron}'
346 server-name: '{gerrit-server-name}'
347 trigger-on: '{obj:gerrit_sonar_triggers}'
349 - project-compare-type: 'ANT'
350 project-pattern: '{project}'
352 - branch-compare-type: 'ANT'
353 branch-pattern: '**/{branch}'
354 file-paths: '{obj:gerrit_trigger_file_paths}'
362 name: '{project-name}-tox-sonar'
364 <<: *lf_python_common
365 # yamllint disable-line rule:key-duplicates
369 - lf-infra-properties:
370 build-days-to-keep: '{build-days-to-keep}'
372 url: '{git-url}/{github-org}/{project}'
375 - lf-infra-github-scm:
376 url: '{git-clone-url}{github-org}/{project}'
377 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
379 submodule-recursive: '{submodule-recursive}'
380 choosing-strategy: default
381 jenkins-ssh-credential: '{jenkins-ssh-credential}'
384 - github-pull-request:
385 trigger-phrase: '^run-sonar$'
386 only-trigger-phrase: false
387 status-context: 'Python Sonar'
390 included-regions: '{obj:github_included_regions}'
396 - lf_tox_verify: &lf_tox_verify
399 ######################
400 # Default parameters #
401 ######################
404 build-days-to-keep: 7
406 git-url: '$GIT_URL/$GERRIT_PROJECT'
408 python-version: python2
410 submodule-recursive: true
414 gerrit_trigger_file_paths:
415 - compare-type: REG_EXP
418 # github_included_regions MUST match gerrit_trigger_file_paths
419 github_included_regions:
422 #####################
423 # Job Configuration #
424 #####################
426 project-type: freestyle
431 - lf-infra-properties:
432 build-days-to-keep: '{build-days-to-keep}'
435 - lf-infra-parameters:
439 lftools-version: '{lftools-version}'
440 - lf-infra-tox-parameters:
442 tox-envs: '{tox-envs}'
445 default: '{parallel}'
446 description: Tox test type used to configure serial or parallel testing.
450 build-timeout: '{build-timeout}'
451 jenkins-ssh-credential: '{jenkins-ssh-credential}'
454 - shell: !include-raw-escape:
455 # Workaround issue where the tox run later breaks the lftools virtualenv.
456 # Without running the install first the run in the publisher will fail
457 # due to missing lftools because it gets installed into a tox venv.
458 - ../shell/lftools-install.sh
459 - lf-infra-tox-install:
460 python-version: '{python-version}'
461 - shell: !include-raw-escape: ../shell/tox-run.sh
467 # Python projects typically use tox to run testing.
468 name: '{project-name}-tox-verify-{stream}'
469 id: gerrit-tox-verify
472 ######################
473 # Default parameters #
474 ######################
476 gerrit_verify_triggers:
477 - patchset-created-event:
479 exclude-trivial-rebase: false
480 exclude-no-code-change: false
481 - draft-published-event
482 - comment-added-contains-event:
483 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
485 #####################
486 # Job Configuration #
487 #####################
490 - lf-infra-gerrit-scm:
491 jenkins-ssh-credential: '{jenkins-ssh-credential}'
493 refspec: '$GERRIT_REFSPEC'
494 branch: '$GERRIT_BRANCH'
495 submodule-recursive: '{submodule-recursive}'
496 choosing-strategy: gerrit
500 server-name: '{gerrit-server-name}'
501 trigger-on: '{obj:gerrit_verify_triggers}'
503 - project-compare-type: ANT
504 project-pattern: '{project}'
506 - branch-compare-type: ANT
507 branch-pattern: '**/{branch}'
508 file-paths: '{obj:gerrit_trigger_file_paths}'
511 # Python projects typically use tox to run testing.
512 name: '{project-name}-tox-verify-{stream}'
513 id: github-tox-verify
517 - lf-infra-properties:
518 build-days-to-keep: '{build-days-to-keep}'
520 url: '{git-url}/{github-org}/{project}'
523 - lf-infra-github-scm:
524 url: '{git-clone-url}{github-org}/{project}'
525 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
527 submodule-recursive: '{submodule-recursive}'
528 choosing-strategy: default
529 jenkins-ssh-credential: '{jenkins-ssh-credential}'
532 - github-pull-request:
533 trigger-phrase: '^(recheck|reverify)$'
534 only-trigger-phrase: false
535 status-context: 'Tox Verify'
538 included-regions: '{obj:github_included_regions}'