8 name: lf-infra-tox-install
11 properties-content: 'PYTHON_VERSION={python-version}'
12 - shell: !include-raw-escape: ../shell/tox-install.sh
15 name: lf-infra-clm-python
18 properties-content: 'CLM_PROJECT_NAME={clm-project-name}'
19 - shell: !include-raw-escape:
20 - ../shell/nexus-iq-cli.sh
26 - lf_python_common: &lf_python_common
27 name: lf-python-common
29 ######################
30 # Default parameters #
31 ######################
40 project-type: freestyle
44 - lf-infra-properties:
45 build-days-to-keep: '{build-days-to-keep}'
48 - lf-infra-parameters:
52 lftools-version: '{lftools-version}'
56 build-timeout: '{build-timeout}'
57 jenkins-ssh-credential: '{jenkins-ssh-credential}'
66 - lf_python_clm_xc: &lf_python_xc_clm
67 name: lf-python-xc-clm
69 ######################
70 # Default parameters #
71 ######################
74 build-days-to-keep: 30 # 30 days for troubleshooting purposes
77 git-url: '$GIT_URL/$PROJECT'
78 github-url: 'https://github.com'
79 java-version: openjdk8
80 nexus-iq-cli-version: 1.44.0-01
81 nexus-iq-namespace: '' # Recommend a trailing dash when set. Example: odl-
83 submodule-recursive: true
86 gerrit_trigger_file_paths:
90 # github_included_regions MUST match gerrit_trigger_file_paths
91 github_included_regions:
98 disabled: '{disable-job}'
101 - lf-infra-parameters:
105 lftools-version: '{lftools-version}'
107 name: NEXUS_IQ_CLI_VERSION
108 default: '{nexus-iq-cli-version}'
109 description: Nexus IQ CLI package to download and use.
112 - credentials-binding:
113 - username-password-separated:
114 credential-id: nexus-iq-xc-clm
116 password: CLM_PASSWORD
118 - lf-update-java-alternatives:
119 java-version: '{java-version}'
120 - lf-infra-clm-python:
121 clm-project-name: '{nexus-iq-namespace}{project-name}'
124 name: '{project-name}-python-clm-{stream}'
125 id: gerrit-python-xc-clm
126 <<: *lf_python_common
127 # yamllint disable-line rule:key-duplicates
128 <<: *lf_python_xc_clm
130 ######################
131 # Default parameters #
132 ######################
135 - comment-added-contains-event:
136 comment-contains-value: run-clm$
138 #####################
139 # Job Configuration #
140 #####################
143 - lf-infra-gerrit-scm:
144 jenkins-ssh-credential: '{jenkins-ssh-credential}'
146 refspec: '$GERRIT_REFSPEC'
147 branch: '$GERRIT_BRANCH'
148 submodule-recursive: '{submodule-recursive}'
149 submodule-timeout: '{submodule-timeout}'
150 choosing-strategy: default
153 # Build weekly on Saturdays
156 server-name: '{gerrit-server-name}'
157 trigger-on: '{obj:gerrit_clm_triggers}'
159 - project-compare-type: ANT
160 project-pattern: '{project}'
162 - branch-compare-type: ANT
163 branch-pattern: '**/{branch}'
164 file-paths: '{obj:gerrit_trigger_file_paths}'
172 name: '{project-name}-python-clm-{stream}'
173 id: github-python-xc-clm
174 <<: *lf_python_common
175 # yamllint disable-line rule:key-duplicates
176 <<: *lf_python_xc_clm
179 - lf-infra-properties:
180 build-days-to-keep: '{build-days-to-keep}'
182 url: '{github-url}/{github-org}/{project}'
185 - lf-infra-github-scm:
186 url: '{git-clone-url}{github-org}/{project}'
188 branch: 'refs/heads/{branch}'
189 submodule-recursive: '{submodule-recursive}'
190 submodule-timeout: '{submodule-timeout}'
191 choosing-strategy: default
192 jenkins-ssh-credential: '{jenkins-ssh-credential}'
195 # Build weekly on Saturdays
197 - github-pull-request:
198 trigger-phrase: '^run-clm$'
199 only-trigger-phrase: false
200 status-context: 'CLM'
203 white-list-target-branches:
205 included-regions: '{obj:github_included_regions}'
207 ########################
208 # Python Sonar with Tox #
209 ########################
211 - lf_tox_sonar: &lf_tox_sonar
214 ######################
215 # Default parameters #
216 ######################
218 branch: master # Sonar should always be run on master branch
219 build-days-to-keep: 7
221 cron: 'H H * * *' # run daily
223 git-url: '$GIT_URL/$PROJECT'
224 github-url: 'https://github.com'
225 java-version: openjdk8
226 python-version: python2
227 mvn-global-settings: global-settings
228 mvn-settings: '{mvn-settings}'
230 sonar-mvn-goal: 'sonar:sonar'
232 submodule-recursive: true
233 submodule-timeout: 10
235 gerrit_trigger_file_paths:
236 - compare-type: REG_EXP
239 # github_included_regions MUST match gerrit_trigger_file_paths
240 github_included_regions:
243 #####################
244 # Job Configuration #
245 #####################
247 disabled: '{disable-job}'
250 - lf-infra-parameters:
254 lftools-version: '{lftools-version}'
256 name: ARCHIVE_ARTIFACTS
257 default: '{archive-artifacts}'
258 description: Artifacts to archive to the logs server.
261 # Sets an env var for shell scripts to be able to call the dynamically
262 # installed maven without having to calculate the path themselves.
263 # yamllint disable-line rule:line-length
264 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
265 description: 'Maven selector to be used by shell scripts'
267 name: SONAR_MAVEN_GOAL
268 default: '{sonar-mvn-goal}'
270 Maven goals to pass to the Sonar call. Typically sonar:sonar
271 however to use a specific version of the sonar-maven-plugin we
272 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
276 - lf-infra-tox-install:
277 python-version: '{python-version}'
278 - shell: !include-raw-escape: ../shell/tox-run.sh
279 - lf-provide-maven-settings:
280 global-settings-file: '{mvn-global-settings}'
281 settings-file: '{mvn-settings}'
282 - lf-infra-tox-sonar:
283 java-version: '{java-version}'
284 mvn-settings: '{mvn-settings}'
285 mvn-version: '{mvn-version}'
291 name: lf-infra-tox-sonar
292 # Run a Sonar build with Maven
295 mvn-version: '{mvn-version}'
296 - lf-update-java-alternatives:
297 java-version: '{java-version}'
299 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
300 properties-content: SONAR_HOST_URL=$SONAR_URL
301 - shell: !include-raw-escape:
302 - ../shell/common-variables.sh
303 - ../shell/maven-sonar.sh
304 - lf-provide-maven-settings-cleanup
307 name: '{project-name}-tox-sonar'
309 <<: *lf_python_common
310 # yamllint disable-line rule:key-duplicates
313 ######################
314 # Default parameters #
315 ######################
317 gerrit_sonar_triggers:
318 - comment-added-contains-event:
319 comment-contains-value: run-sonar$
321 #####################
322 # Job Configuration #
323 #####################
326 - lf-infra-gerrit-scm:
327 jenkins-ssh-credential: '{jenkins-ssh-credential}'
329 refspec: $GERRIT_REFSPEC
330 branch: $GERRIT_BRANCH
331 submodule-recursive: '{submodule-recursive}'
332 submodule-timeout: '{submodule-timeout}'
333 choosing-strategy: default
336 - timed: '{obj:cron}'
338 server-name: '{gerrit-server-name}'
339 trigger-on: '{obj:gerrit_sonar_triggers}'
341 - project-compare-type: 'ANT'
342 project-pattern: '{project}'
344 - branch-compare-type: 'ANT'
345 branch-pattern: '**/{branch}'
346 file-paths: '{obj:gerrit_trigger_file_paths}'
354 name: '{project-name}-tox-sonar'
356 <<: *lf_python_common
357 # yamllint disable-line rule:key-duplicates
361 - lf-infra-properties:
362 build-days-to-keep: '{build-days-to-keep}'
364 url: '{github-url}/{github-org}/{project}'
367 - lf-infra-github-scm:
368 url: '{git-clone-url}{github-org}/{project}'
369 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
371 submodule-recursive: '{submodule-recursive}'
372 submodule-timeout: '{submodule-timeout}'
373 choosing-strategy: default
374 jenkins-ssh-credential: '{jenkins-ssh-credential}'
377 - github-pull-request:
378 trigger-phrase: '^run-sonar$'
379 only-trigger-phrase: false
380 status-context: 'Python Sonar'
383 white-list-target-branches:
385 included-regions: '{obj:github_included_regions}'
391 - lf_tox_verify: &lf_tox_verify
394 ######################
395 # Default parameters #
396 ######################
399 build-days-to-keep: 7
402 git-url: '$GIT_URL/$GERRIT_PROJECT'
403 github-url: 'https://github.com'
405 python-version: python2
407 submodule-recursive: true
408 submodule-timeout: 10
412 gerrit_trigger_file_paths:
413 - compare-type: REG_EXP
416 # github_included_regions MUST match gerrit_trigger_file_paths
417 github_included_regions:
420 #####################
421 # Job Configuration #
422 #####################
424 project-type: freestyle
427 disabled: '{disable-job}'
430 - lf-infra-properties:
431 build-days-to-keep: '{build-days-to-keep}'
434 - lf-infra-parameters:
438 lftools-version: '{lftools-version}'
439 - lf-infra-tox-parameters:
441 tox-envs: '{tox-envs}'
444 default: '{parallel}'
445 description: Tox test type used to configure serial or parallel testing.
449 build-timeout: '{build-timeout}'
450 jenkins-ssh-credential: '{jenkins-ssh-credential}'
454 - lf-infra-tox-install:
455 python-version: '{python-version}'
456 - shell: !include-raw-escape: ../shell/tox-run.sh
462 # Python projects typically use tox to run testing.
463 name: '{project-name}-tox-verify-{stream}'
464 id: gerrit-tox-verify
467 ######################
468 # Default parameters #
469 ######################
471 gerrit_verify_triggers:
472 - patchset-created-event:
474 exclude-trivial-rebase: false
475 exclude-no-code-change: false
476 - draft-published-event
477 - comment-added-contains-event:
478 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
480 #####################
481 # Job Configuration #
482 #####################
485 - lf-infra-gerrit-scm:
486 jenkins-ssh-credential: '{jenkins-ssh-credential}'
488 refspec: '$GERRIT_REFSPEC'
489 branch: '$GERRIT_BRANCH'
490 submodule-recursive: '{submodule-recursive}'
491 submodule-timeout: '{submodule-timeout}'
492 choosing-strategy: gerrit
496 server-name: '{gerrit-server-name}'
497 trigger-on: '{obj:gerrit_verify_triggers}'
499 - project-compare-type: ANT
500 project-pattern: '{project}'
502 - branch-compare-type: ANT
503 branch-pattern: '**/{branch}'
504 file-paths: '{obj:gerrit_trigger_file_paths}'
507 # Python projects typically use tox to run testing.
508 name: '{project-name}-tox-verify-{stream}'
509 id: github-tox-verify
513 - lf-infra-properties:
514 build-days-to-keep: '{build-days-to-keep}'
516 url: '{github-url}/{github-org}/{project}'
519 - lf-infra-github-scm:
520 url: '{git-clone-url}{github-org}/{project}'
521 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
523 submodule-recursive: '{submodule-recursive}'
524 submodule-timeout: '{submodule-timeout}'
525 choosing-strategy: default
526 jenkins-ssh-credential: '{jenkins-ssh-credential}'
529 - github-pull-request:
530 trigger-phrase: '^(recheck|reverify)$'
531 only-trigger-phrase: false
532 status-context: 'Tox Verify'
535 white-list-target-branches:
537 included-regions: '{obj:github_included_regions}'