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 ######################
54 nexus-iq-cli-version: 1.44.0-01
60 project-type: freestyle
64 - lf-infra-properties:
65 build-days-to-keep: '{build-days-to-keep}'
68 - lf-infra-parameters:
72 lftools-version: '{lftools-version}'
76 build-timeout: '{build-timeout}'
77 jenkins-ssh-credential: '{jenkins-ssh-credential}'
86 - lf_python_clm_xc: &lf_python_xc_clm
87 name: lf-python-xc-clm
89 ######################
90 # Default parameters #
91 ######################
94 build-days-to-keep: 30 # 30 days for troubleshooting purposes
96 git-url: '$GIT_URL/$PROJECT'
97 java-version: openjdk8
98 staging-profile-id: '' # Unused in this job
100 submodule-recursive: true
103 - comment-added-contains-event:
104 comment-contains-value: run-clm$
105 gerrit_trigger_file_paths:
109 #####################
110 # Job Configuration #
111 #####################
115 name: NEXUS_IQ_CLI_VERSION
116 default: '{nexus-iq-cli-version}'
117 description: Nexus IQ CLI package to download and use.
120 # Build weekly on Saturdays
123 server-name: '{gerrit-server-name}'
124 trigger-on: '{obj:gerrit_clm_triggers}'
126 - project-compare-type: ANT
127 project-pattern: '{project}'
129 - branch-compare-type: ANT
130 branch-pattern: '**/{branch}'
131 file-paths: '{obj:gerrit_trigger_file_paths}'
138 - credentials-binding:
139 - username-password-separated:
140 credential-id: nexus-iq-xc-clm
142 password: CLM_PASSWORD
144 - lf-update-java-alternatives:
145 java-version: '{java-version}'
146 - lf-infra-clm-python:
147 clm-project-name: '{project-name}'
150 name: '{project-name}-python-clm-{stream}'
151 id: gerrit-python-xc-clm
152 <<: *lf_python_common
153 # yamllint disable-line rule:key-duplicates
154 <<: *lf_python_xc_clm
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 name: '{project-name}-python-clm-{stream}'
167 id: github-python-xc-clm
168 <<: *lf_python_common
169 # yamllint disable-line rule:key-duplicates
170 <<: *lf_python_xc_clm
174 url: '{git-url}/{github-org}/{project}'
177 - lf-infra-github-scm:
178 url: '{git-clone-url}{github-org}/{project}'
180 branch: 'refs/heads/{branch}'
181 submodule-recursive: '{submodule-recursive}'
182 choosing-strategy: default
183 jenkins-ssh-credential: '{jenkins-ssh-credential}'
186 - lf-infra-github-pr-trigger:
187 trigger-phrase: '^run-clm$'
188 only-trigger-phrase: false
189 status-context: 'CLM'
195 github_pr_admin_list:
198 ########################
199 # Python Sonar with Tox #
200 ########################
202 - lf_tox_sonar: &lf_tox_sonar
205 ######################
206 # Default parameters #
207 ######################
209 branch: master # Sonar should always be run on master branch
210 build-days-to-keep: 7
212 cron: 'H H * * *' # run daily
213 git-url: '$GIT_URL/$PROJECT'
214 java-version: openjdk8
215 python-version: python2
216 mvn-global-settings: global-settings
217 mvn-settings: '{mvn-settings}'
219 sonar-mvn-goal: 'sonar:sonar'
221 submodule-recursive: true
223 gerrit_sonar_triggers:
224 - comment-added-contains-event:
225 comment-contains-value: run-sonar$
226 gerrit_trigger_file_paths:
230 #####################
231 # Job Configuration #
232 #####################
235 - lf-infra-parameters:
239 lftools-version: '{lftools-version}'
241 name: ARCHIVE_ARTIFACTS
242 default: '{archive-artifacts}'
243 description: Artifacts to archive to the logs server.
246 # Sets an env var for shell scripts to be able to call the dynamically
247 # installed maven without having to calculate the path themselves.
248 # yamllint disable-line rule:line-length
249 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
250 description: 'Maven selector to be used by shell scripts'
252 name: SONAR_MAVEN_GOAL
253 default: '{sonar-mvn-goal}'
255 Maven goals to pass to the Sonar call. Typically sonar:sonar
256 however to use a specific version of the sonar-maven-plugin we
257 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
260 - timed: '{obj:cron}'
262 server-name: '{gerrit-server-name}'
263 trigger-on: '{obj:gerrit_sonar_triggers}'
265 - project-compare-type: 'ANT'
266 project-pattern: '{project}'
268 - branch-compare-type: 'ANT'
269 branch-pattern: '**/master'
270 file-paths: '{obj:gerrit_trigger_file_paths}'
278 - shell: !include-raw-escape:
279 # Workaround issue where the tox run later breaks the lftools virtualenv.
280 # Without running the install first the run in the publisher will fail
281 # due to missing lftools because it gets installed into a tox venv.
282 - ../shell/lftools-install.sh
283 - lf-infra-tox-install:
284 python-version: '{python-version}'
285 - shell: !include-raw-escape: ../shell/tox-run.sh
286 - lf-provide-maven-settings:
287 global-settings-file: '{mvn-global-settings}'
288 settings-file: '{mvn-settings}'
289 - lf-infra-tox-sonar:
290 java-version: '{java-version}'
291 mvn-settings: '{mvn-settings}'
292 mvn-version: '{mvn-version}'
298 name: lf-infra-tox-sonar
299 # Run a Sonar build with Maven
302 mvn-version: '{mvn-version}'
303 - lf-update-java-alternatives:
304 java-version: '{java-version}'
306 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
307 properties-content: SONAR_HOST_URL=$SONAR_URL
308 - shell: !include-raw-escape:
309 - ../shell/common-variables.sh
310 - ../shell/maven-sonar.sh
311 - lf-provide-maven-settings-cleanup
314 name: '{project-name}-tox-sonar'
316 <<: *lf_python_common
317 # yamllint disable-line rule:key-duplicates
321 - lf-infra-gerrit-scm:
322 jenkins-ssh-credential: '{jenkins-ssh-credential}'
324 refspec: $GERRIT_REFSPEC
325 branch: $GERRIT_BRANCH
326 submodule-recursive: '{submodule-recursive}'
327 choosing-strategy: default
330 name: '{project-name}-tox-sonar'
332 <<: *lf_python_common
333 # yamllint disable-line rule:key-duplicates
338 url: '{git-url}/{github-org}/{project}'
341 - lf-infra-github-scm:
342 url: '{git-clone-url}{github-org}/{project}'
343 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
345 submodule-recursive: '{submodule-recursive}'
346 choosing-strategy: default
347 jenkins-ssh-credential: '{jenkins-ssh-credential}'
350 - lf-infra-github-pr-trigger:
351 trigger-phrase: '^run-sonar$'
352 only-trigger-phrase: false
353 status-context: 'Python Sonar'
359 github_pr_admin_list:
366 - lf_tox_verify: &lf_tox_verify
369 ######################
370 # Default parameters #
371 ######################
374 build-days-to-keep: 7
376 git-url: '$GIT_URL/$GERRIT_PROJECT'
377 python-version: python2
379 submodule-recursive: true
383 #####################
384 # Job Configuration #
385 #####################
387 project-type: freestyle
392 - lf-infra-properties:
393 build-days-to-keep: '{build-days-to-keep}'
396 - lf-infra-parameters:
400 lftools-version: '{lftools-version}'
401 - lf-infra-tox-parameters:
403 tox-envs: '{tox-envs}'
407 build-timeout: '{build-timeout}'
408 jenkins-ssh-credential: '{jenkins-ssh-credential}'
411 - shell: !include-raw-escape:
412 # Workaround issue where the tox run later breaks the lftools virtualenv.
413 # Without running the install first the run in the publisher will fail
414 # due to missing lftools because it gets installed into a tox venv.
415 - ../shell/lftools-install.sh
416 - lf-infra-tox-install:
417 python-version: '{python-version}'
418 - shell: !include-raw-escape: ../shell/tox-run.sh
424 # Python projects typically use tox to run testing.
425 name: '{project-name}-tox-verify-{stream}'
426 id: gerrit-tox-verify
429 ######################
430 # Default parameters #
431 ######################
433 gerrit_verify_triggers:
434 - patchset-created-event:
436 exclude-trivial-rebase: false
437 exclude-no-code-change: false
438 - draft-published-event
439 - comment-added-contains-event:
440 comment-contains-value: recheck$
441 gerrit_trigger_file_paths:
447 #####################
448 # Job Configuration #
449 #####################
452 - lf-infra-gerrit-scm:
453 jenkins-ssh-credential: '{jenkins-ssh-credential}'
455 refspec: '$GERRIT_REFSPEC'
456 branch: '$GERRIT_BRANCH'
457 submodule-recursive: '{submodule-recursive}'
458 choosing-strategy: gerrit
463 default: '{parallel}'
464 description: Tox test type used to configure serial or parallel testing.
469 server-name: '{gerrit-server-name}'
470 trigger-on: '{obj:gerrit_verify_triggers}'
472 - project-compare-type: ANT
473 project-pattern: '{project}'
475 - branch-compare-type: ANT
476 branch-pattern: '**/{branch}'
477 file-paths: '{obj:gerrit_trigger_file_paths}'
480 # Python projects typically use tox to run testing.
481 name: '{project-name}-tox-verify-{stream}'
482 id: github-tox-verify
487 url: '{git-url}/{github-org}/{project}'
490 - lf-infra-github-scm:
491 url: '{git-clone-url}{github-org}/{project}'
492 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
494 submodule-recursive: '{submodule-recursive}'
495 choosing-strategy: default
496 jenkins-ssh-credential: '{jenkins-ssh-credential}'
499 - github-pull-request:
500 trigger-phrase: '^recheck$'
501 only-trigger-phrase: false
502 status-context: 'JJB Verify'
505 auto-close-on-fail: false