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
85 gerrit_trigger_file_paths:
89 # github_included_regions MUST match gerrit_trigger_file_paths
90 github_included_regions:
97 disabled: '{disable-job}'
100 - lf-infra-parameters:
104 lftools-version: '{lftools-version}'
106 name: NEXUS_IQ_CLI_VERSION
107 default: '{nexus-iq-cli-version}'
108 description: Nexus IQ CLI package to download and use.
111 - credentials-binding:
112 - username-password-separated:
113 credential-id: nexus-iq-xc-clm
115 password: CLM_PASSWORD
117 - lf-update-java-alternatives:
118 java-version: '{java-version}'
119 - lf-infra-clm-python:
120 clm-project-name: '{nexus-iq-namespace}{project-name}'
123 name: '{project-name}-python-clm-{stream}'
124 id: gerrit-python-xc-clm
125 <<: *lf_python_common
126 # yamllint disable-line rule:key-duplicates
127 <<: *lf_python_xc_clm
129 ######################
130 # Default parameters #
131 ######################
134 - comment-added-contains-event:
135 comment-contains-value: run-clm$
137 #####################
138 # Job Configuration #
139 #####################
142 - lf-infra-gerrit-scm:
143 jenkins-ssh-credential: '{jenkins-ssh-credential}'
145 refspec: '$GERRIT_REFSPEC'
146 branch: '$GERRIT_BRANCH'
147 submodule-recursive: '{submodule-recursive}'
148 choosing-strategy: default
151 # Build weekly on Saturdays
154 server-name: '{gerrit-server-name}'
155 trigger-on: '{obj:gerrit_clm_triggers}'
157 - project-compare-type: ANT
158 project-pattern: '{project}'
160 - branch-compare-type: ANT
161 branch-pattern: '**/{branch}'
162 file-paths: '{obj:gerrit_trigger_file_paths}'
170 name: '{project-name}-python-clm-{stream}'
171 id: github-python-xc-clm
172 <<: *lf_python_common
173 # yamllint disable-line rule:key-duplicates
174 <<: *lf_python_xc_clm
177 - lf-infra-properties:
178 build-days-to-keep: '{build-days-to-keep}'
180 url: '{github-url}/{github-org}/{project}'
183 - lf-infra-github-scm:
184 url: '{git-clone-url}{github-org}/{project}'
186 branch: 'refs/heads/{branch}'
187 submodule-recursive: '{submodule-recursive}'
188 choosing-strategy: default
189 jenkins-ssh-credential: '{jenkins-ssh-credential}'
192 # Build weekly on Saturdays
194 - github-pull-request:
195 trigger-phrase: '^run-clm$'
196 only-trigger-phrase: false
197 status-context: 'CLM'
200 white-list-target-branches:
202 included-regions: '{obj:github_included_regions}'
204 ########################
205 # Python Sonar with Tox #
206 ########################
208 - lf_tox_sonar: &lf_tox_sonar
211 ######################
212 # Default parameters #
213 ######################
215 branch: master # Sonar should always be run on master branch
216 build-days-to-keep: 7
218 cron: 'H H * * *' # run daily
220 git-url: '$GIT_URL/$PROJECT'
221 github-url: 'https://github.com'
222 java-version: openjdk8
223 python-version: python2
224 mvn-global-settings: global-settings
225 mvn-settings: '{mvn-settings}'
227 sonar-mvn-goal: 'sonar:sonar'
229 submodule-recursive: true
231 gerrit_trigger_file_paths:
232 - compare-type: REG_EXP
235 # github_included_regions MUST match gerrit_trigger_file_paths
236 github_included_regions:
239 #####################
240 # Job Configuration #
241 #####################
243 disabled: '{disable-job}'
246 - lf-infra-parameters:
250 lftools-version: '{lftools-version}'
252 name: ARCHIVE_ARTIFACTS
253 default: '{archive-artifacts}'
254 description: Artifacts to archive to the logs server.
257 # Sets an env var for shell scripts to be able to call the dynamically
258 # installed maven without having to calculate the path themselves.
259 # yamllint disable-line rule:line-length
260 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
261 description: 'Maven selector to be used by shell scripts'
263 name: SONAR_MAVEN_GOAL
264 default: '{sonar-mvn-goal}'
266 Maven goals to pass to the Sonar call. Typically sonar:sonar
267 however to use a specific version of the sonar-maven-plugin we
268 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
272 - lf-infra-tox-install:
273 python-version: '{python-version}'
274 - shell: !include-raw-escape: ../shell/tox-run.sh
275 - lf-provide-maven-settings:
276 global-settings-file: '{mvn-global-settings}'
277 settings-file: '{mvn-settings}'
278 - lf-infra-tox-sonar:
279 java-version: '{java-version}'
280 mvn-settings: '{mvn-settings}'
281 mvn-version: '{mvn-version}'
287 name: lf-infra-tox-sonar
288 # Run a Sonar build with Maven
291 mvn-version: '{mvn-version}'
292 - lf-update-java-alternatives:
293 java-version: '{java-version}'
295 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
296 properties-content: SONAR_HOST_URL=$SONAR_URL
297 - shell: !include-raw-escape:
298 - ../shell/common-variables.sh
299 - ../shell/maven-sonar.sh
300 - lf-provide-maven-settings-cleanup
303 name: '{project-name}-tox-sonar'
305 <<: *lf_python_common
306 # yamllint disable-line rule:key-duplicates
309 ######################
310 # Default parameters #
311 ######################
313 gerrit_sonar_triggers:
314 - comment-added-contains-event:
315 comment-contains-value: run-sonar$
317 #####################
318 # Job Configuration #
319 #####################
322 - lf-infra-gerrit-scm:
323 jenkins-ssh-credential: '{jenkins-ssh-credential}'
325 refspec: $GERRIT_REFSPEC
326 branch: $GERRIT_BRANCH
327 submodule-recursive: '{submodule-recursive}'
328 choosing-strategy: default
331 - timed: '{obj:cron}'
333 server-name: '{gerrit-server-name}'
334 trigger-on: '{obj:gerrit_sonar_triggers}'
336 - project-compare-type: 'ANT'
337 project-pattern: '{project}'
339 - branch-compare-type: 'ANT'
340 branch-pattern: '**/{branch}'
341 file-paths: '{obj:gerrit_trigger_file_paths}'
349 name: '{project-name}-tox-sonar'
351 <<: *lf_python_common
352 # yamllint disable-line rule:key-duplicates
356 - lf-infra-properties:
357 build-days-to-keep: '{build-days-to-keep}'
359 url: '{github-url}/{github-org}/{project}'
362 - lf-infra-github-scm:
363 url: '{git-clone-url}{github-org}/{project}'
364 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
366 submodule-recursive: '{submodule-recursive}'
367 choosing-strategy: default
368 jenkins-ssh-credential: '{jenkins-ssh-credential}'
371 - github-pull-request:
372 trigger-phrase: '^run-sonar$'
373 only-trigger-phrase: false
374 status-context: 'Python Sonar'
377 white-list-target-branches:
379 included-regions: '{obj:github_included_regions}'
385 - lf_tox_verify: &lf_tox_verify
388 ######################
389 # Default parameters #
390 ######################
393 build-days-to-keep: 7
396 git-url: '$GIT_URL/$GERRIT_PROJECT'
397 github-url: 'https://github.com'
399 python-version: python2
401 submodule-recursive: true
405 gerrit_trigger_file_paths:
406 - compare-type: REG_EXP
409 # github_included_regions MUST match gerrit_trigger_file_paths
410 github_included_regions:
413 #####################
414 # Job Configuration #
415 #####################
417 project-type: freestyle
420 disabled: '{disable-job}'
423 - lf-infra-properties:
424 build-days-to-keep: '{build-days-to-keep}'
427 - lf-infra-parameters:
431 lftools-version: '{lftools-version}'
432 - lf-infra-tox-parameters:
434 tox-envs: '{tox-envs}'
437 default: '{parallel}'
438 description: Tox test type used to configure serial or parallel testing.
442 build-timeout: '{build-timeout}'
443 jenkins-ssh-credential: '{jenkins-ssh-credential}'
447 - lf-infra-tox-install:
448 python-version: '{python-version}'
449 - shell: !include-raw-escape: ../shell/tox-run.sh
455 # Python projects typically use tox to run testing.
456 name: '{project-name}-tox-verify-{stream}'
457 id: gerrit-tox-verify
460 ######################
461 # Default parameters #
462 ######################
464 gerrit_verify_triggers:
465 - patchset-created-event:
467 exclude-trivial-rebase: false
468 exclude-no-code-change: false
469 - draft-published-event
470 - comment-added-contains-event:
471 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
473 #####################
474 # Job Configuration #
475 #####################
478 - lf-infra-gerrit-scm:
479 jenkins-ssh-credential: '{jenkins-ssh-credential}'
481 refspec: '$GERRIT_REFSPEC'
482 branch: '$GERRIT_BRANCH'
483 submodule-recursive: '{submodule-recursive}'
484 choosing-strategy: gerrit
488 server-name: '{gerrit-server-name}'
489 trigger-on: '{obj:gerrit_verify_triggers}'
491 - project-compare-type: ANT
492 project-pattern: '{project}'
494 - branch-compare-type: ANT
495 branch-pattern: '**/{branch}'
496 file-paths: '{obj:gerrit_trigger_file_paths}'
499 # Python projects typically use tox to run testing.
500 name: '{project-name}-tox-verify-{stream}'
501 id: github-tox-verify
505 - lf-infra-properties:
506 build-days-to-keep: '{build-days-to-keep}'
508 url: '{github-url}/{github-org}/{project}'
511 - lf-infra-github-scm:
512 url: '{git-clone-url}{github-org}/{project}'
513 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
515 submodule-recursive: '{submodule-recursive}'
516 choosing-strategy: default
517 jenkins-ssh-credential: '{jenkins-ssh-credential}'
520 - github-pull-request:
521 trigger-phrase: '^(recheck|reverify)$'
522 only-trigger-phrase: false
523 status-context: 'Tox Verify'
526 white-list-target-branches:
528 included-regions: '{obj:github_included_regions}'