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/sonar-cli.sh
45 - lf_python_common: &lf_python_common
46 name: lf-python-common
48 ######################
49 # Default parameters #
50 ######################
55 **/target/**/feature.xml
56 **/target/failsafe-reports/failsafe-summary.xml
57 **/target/surefire-reports/*-output.txt
63 project-type: freestyle
67 - lf-infra-properties:
68 build-days-to-keep: '{build-days-to-keep}'
71 - lf-infra-parameters:
75 lftools-version: '{lftools-version}'
77 name: NEXUS_IQ_CLI_JAR
78 default: nexus-iq-cli-1.44.0-01.jar
79 description: Nexus IQ CLI package to download and use.
81 name: ARCHIVE_ARTIFACTS
82 default: '{archive-artifacts}'
83 description: Artifacts to archive to the logs server.
87 build-timeout: '{build-timeout}'
88 jenkins-ssh-credential: '{jenkins-ssh-credential}'
97 - lf_python_clm_xc: &lf_python_xc_clm
98 name: lf-python-xc-clm
100 ######################
101 # Default parameters #
102 ######################
105 build-days-to-keep: 30 # 30 days for troubleshooting purposes
107 git-url: '$GIT_URL/$PROJECT'
108 java-version: openjdk8
109 staging-profile-id: '' # Unused in this job
111 submodule-recursive: true
114 - comment-added-contains-event:
115 comment-contains-value: run-xc-clm$
117 #####################
118 # Job Configuration #
119 #####################
122 # Build weekly on Saturdays
125 server-name: '{gerrit-server-name}'
126 trigger-on: '{obj:gerrit_clm_triggers}'
128 - project-compare-type: ANT
129 project-pattern: '{project}'
131 - branch-compare-type: ANT
132 branch-pattern: '**/{branch}'
139 - credentials-binding:
140 - username-password-separated:
141 credential-id: sonar-xc-clm
143 password: CLM_PASSWORD
145 - lf-update-java-alternatives:
146 java-version: '{java-version}'
147 - lf-infra-clm-python:
148 clm-project-name: '{project-name}'
151 name: '{project-name}-python-clm-{stream}'
152 id: gerrit-python-xc-clm
153 <<: *lf_python_common
154 # yamllint disable-line rule:key-duplicates
155 <<: *lf_python_xc_clm
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 name: '{project-name}-python-clm-{stream}'
168 id: github-python-xc-clm
169 <<: *lf_python_common
170 # yamllint disable-line rule:key-duplicates
171 <<: *lf_python_xc_clm
175 url: '{git-url}/{github-org}/{project}'
178 - lf-infra-github-scm:
179 url: '{git-clone-url}{github-org}/{project}'
181 branch: 'refs/heads/{branch}'
182 submodule-recursive: '{submodule-recursive}'
183 choosing-strategy: default
184 jenkins-ssh-credential: '{jenkins-ssh-credential}'
187 - lf-infra-github-pr-trigger:
188 trigger-phrase: '^run-xc-clm$'
189 only-trigger-phrase: false
190 status-context: 'CLM'
196 github_pr_admin_list:
199 ########################
200 # Python Sonar with Tox #
201 ########################
203 - lf_tox_sonar: &lf_tox_sonar
206 ######################
207 # Default parameters #
208 ######################
210 branch: master # Sonar should always be run on master branch
211 build-days-to-keep: 7
213 cron: 'H H * * *' # run daily
214 git-url: '$GIT_URL/$PROJECT'
215 java-version: openjdk8
216 python-version: python2
217 mvn-global-settings: global-settings
218 mvn-settings: '{mvn-settings}'
220 sonar-mvn-goal: 'sonar:sonar'
222 submodule-recursive: true
224 gerrit_sonar_triggers:
225 - comment-added-contains-event:
226 comment-contains-value: run-sonar$
228 #####################
229 # Job Configuration #
230 #####################
233 - lf-infra-parameters:
237 lftools-version: '{lftools-version}'
239 name: ARCHIVE_ARTIFACTS
240 default: '{archive-artifacts}'
241 description: Artifacts to archive to the logs server.
244 # Sets an env var for shell scripts to be able to call the dynamically
245 # installed maven without having to calculate the path themselves.
246 # yamllint disable-line rule:line-length
247 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
248 description: 'Maven selector to be used by shell scripts'
250 name: SONAR_MAVEN_GOAL
251 default: '{sonar-mvn-goal}'
253 Maven goals to pass to the Sonar call. Typically sonar:sonar
254 however to use a specific version of the sonar-maven-plugin we
255 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
258 - timed: '{obj:cron}'
260 server-name: '{gerrit-server-name}'
261 trigger-on: '{obj:gerrit_sonar_triggers}'
263 - project-compare-type: 'ANT'
264 project-pattern: '{project}'
266 - branch-compare-type: 'ANT'
267 branch-pattern: '**/master'
275 - shell: !include-raw-escape:
276 # Workaround issue where the tox run later breaks the lftools virtualenv.
277 # Without running the install first the run in the publisher will fail
278 # due to missing lftools because it gets installed into a tox venv.
279 - ../shell/lftools-install.sh
280 - lf-infra-tox-install:
281 python-version: '{python-version}'
282 - shell: !include-raw-escape: ../shell/tox-run.sh
283 - lf-provide-maven-settings:
284 global-settings-file: '{mvn-global-settings}'
285 settings-file: '{mvn-settings}'
286 - lf-infra-tox-sonar:
287 java-version: '{java-version}'
288 mvn-settings: '{mvn-settings}'
289 mvn-version: '{mvn-version}'
295 name: lf-infra-tox-sonar
296 # Run a Sonar build with Maven
299 mvn-version: '{mvn-version}'
300 - lf-update-java-alternatives:
301 java-version: '{java-version}'
303 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
304 properties-content: SONAR_HOST_URL=$SONAR_URL
305 - shell: !include-raw-escape:
306 - ../shell/common-variables.sh
307 - ../shell/maven-sonar.sh
308 - lf-provide-maven-settings-cleanup
311 name: '{project-name}-tox-sonar'
313 <<: *lf_python_common
314 # yamllint disable-line rule:key-duplicates
318 - lf-infra-gerrit-scm:
319 jenkins-ssh-credential: '{jenkins-ssh-credential}'
321 refspec: $GERRIT_REFSPEC
322 branch: $GERRIT_BRANCH
323 submodule-recursive: '{submodule-recursive}'
324 choosing-strategy: default
327 name: '{project-name}-tox-sonar'
329 <<: *lf_python_common
330 # yamllint disable-line rule:key-duplicates
335 url: '{git-url}/{github-org}/{project}'
338 - lf-infra-github-scm:
339 url: '{git-clone-url}{github-org}/{project}'
340 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
342 submodule-recursive: '{submodule-recursive}'
343 choosing-strategy: default
344 jenkins-ssh-credential: '{jenkins-ssh-credential}'
347 - lf-infra-github-pr-trigger:
348 trigger-phrase: '^run-sonar$'
349 only-trigger-phrase: false
350 status-context: 'Python Sonar'
356 github_pr_admin_list:
363 - lf_tox_verify: &lf_tox_verify
366 ######################
367 # Default parameters #
368 ######################
371 build-days-to-keep: 7
373 git-url: '$GIT_URL/$GERRIT_PROJECT'
374 python-version: python2
376 submodule-recursive: true
380 #####################
381 # Job Configuration #
382 #####################
384 project-type: freestyle
389 - lf-infra-properties:
390 build-days-to-keep: '{build-days-to-keep}'
393 - lf-infra-parameters:
397 lftools-version: '{lftools-version}'
398 - lf-infra-tox-parameters:
400 tox-envs: '{tox-envs}'
404 build-timeout: '{build-timeout}'
405 jenkins-ssh-credential: '{jenkins-ssh-credential}'
408 - shell: !include-raw-escape:
409 # Workaround issue where the tox run later breaks the lftools virtualenv.
410 # Without running the install first the run in the publisher will fail
411 # due to missing lftools because it gets installed into a tox venv.
412 - ../shell/lftools-install.sh
413 - lf-infra-tox-install:
414 python-version: '{python-version}'
415 - shell: !include-raw-escape: ../shell/tox-run.sh
421 # Python projects typically use tox to run testing.
422 name: '{project-name}-tox-verify-{stream}'
423 id: gerrit-tox-verify
426 ######################
427 # Default parameters #
428 ######################
430 gerrit_verify_triggers:
431 - patchset-created-event:
433 exclude-trivial-rebase: false
434 exclude-no-code-change: false
435 - draft-published-event
436 - comment-added-contains-event:
437 comment-contains-value: recheck$
439 #####################
440 # Job Configuration #
441 #####################
444 - lf-infra-gerrit-scm:
445 jenkins-ssh-credential: '{jenkins-ssh-credential}'
447 refspec: '$GERRIT_REFSPEC'
448 branch: '$GERRIT_BRANCH'
449 submodule-recursive: '{submodule-recursive}'
450 choosing-strategy: gerrit
454 server-name: '{gerrit-server-name}'
455 trigger-on: '{obj:gerrit_verify_triggers}'
457 - project-compare-type: ANT
458 project-pattern: '{project}'
460 - branch-compare-type: ANT
461 branch-pattern: '**/{branch}'
464 # Python projects typically use tox to run testing.
465 name: '{project-name}-tox-verify-{stream}'
466 id: github-tox-verify
471 url: '{git-url}/{github-org}/{project}'
474 - lf-infra-github-scm:
475 url: '{git-clone-url}{github-org}/{project}'
476 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
478 submodule-recursive: '{submodule-recursive}'
479 choosing-strategy: default
480 jenkins-ssh-credential: '{jenkins-ssh-credential}'
483 - github-pull-request:
484 trigger-phrase: '^recheck$'
485 only-trigger-phrase: false
486 status-context: 'JJB Verify'
489 auto-close-on-fail: false