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:
55 build-timeout: '{build-timeout}'
56 jenkins-ssh-credential: '{jenkins-ssh-credential}'
65 - lf_python_clm_xc: &lf_python_xc_clm
66 name: lf-python-xc-clm
68 ######################
69 # Default parameters #
70 ######################
73 build-days-to-keep: 30 # 30 days for troubleshooting purposes
76 git-url: '$GIT_URL/$PROJECT'
77 github-url: 'https://github.com'
78 java-version: openjdk8
79 nexus-iq-cli-version: 1.44.0-01
80 nexus-iq-namespace: '' # Recommend a trailing dash when set. Example: odl-
82 submodule-recursive: true
84 submodule-disable: false
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:
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 submodule-timeout: '{submodule-timeout}'
149 submodule-disable: '{submodule-disable}'
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 submodule-disable: '{submodule-disable}'
192 choosing-strategy: default
193 jenkins-ssh-credential: '{jenkins-ssh-credential}'
196 # Build weekly on Saturdays
198 - github-pull-request:
199 trigger-phrase: '^run-clm$'
200 only-trigger-phrase: false
201 status-context: 'CLM'
204 white-list-target-branches:
206 included-regions: '{obj:github_included_regions}'
208 ########################
209 # Python Sonar with Tox #
210 ########################
212 - lf_tox_sonar: &lf_tox_sonar
215 ######################
216 # Default parameters #
217 ######################
219 branch: master # Sonar should always be run on master branch
220 build-days-to-keep: 7
222 cron: 'H H * * *' # run daily
224 git-url: '$GIT_URL/$PROJECT'
225 github-url: 'https://github.com'
226 java-version: openjdk8
227 python-version: python2
228 mvn-global-settings: global-settings
229 mvn-settings: '{mvn-settings}'
231 sonar-mvn-goal: 'sonar:sonar'
233 submodule-recursive: true
234 submodule-timeout: 10
235 submodule-disable: false
237 gerrit_trigger_file_paths:
238 - compare-type: REG_EXP
241 # github_included_regions MUST match gerrit_trigger_file_paths
242 github_included_regions:
245 #####################
246 # Job Configuration #
247 #####################
249 disabled: '{disable-job}'
252 - lf-infra-parameters:
257 name: ARCHIVE_ARTIFACTS
258 default: '{archive-artifacts}'
259 description: Artifacts to archive to the logs server.
262 # Sets an env var for shell scripts to be able to call the dynamically
263 # installed maven without having to calculate the path themselves.
264 # yamllint disable-line rule:line-length
265 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
266 description: 'Maven selector to be used by shell scripts'
268 name: SONAR_MAVEN_GOAL
269 default: '{sonar-mvn-goal}'
271 Maven goals to pass to the Sonar call. Typically sonar:sonar
272 however to use a specific version of the sonar-maven-plugin we
273 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
277 - lf-infra-tox-install:
278 python-version: '{python-version}'
279 - shell: !include-raw-escape: ../shell/tox-run.sh
280 - lf-provide-maven-settings:
281 global-settings-file: '{mvn-global-settings}'
282 settings-file: '{mvn-settings}'
283 - lf-infra-tox-sonar:
284 java-version: '{java-version}'
285 mvn-settings: '{mvn-settings}'
286 mvn-version: '{mvn-version}'
292 name: lf-infra-tox-sonar
293 # Run a Sonar build with Maven
296 mvn-version: '{mvn-version}'
297 - lf-update-java-alternatives:
298 java-version: '{java-version}'
300 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
301 properties-content: SONAR_HOST_URL=$SONAR_URL
302 - shell: !include-raw-escape:
303 - ../shell/common-variables.sh
304 - ../shell/maven-sonar.sh
305 - lf-provide-maven-settings-cleanup
308 name: '{project-name}-tox-sonar'
310 <<: *lf_python_common
311 # yamllint disable-line rule:key-duplicates
314 ######################
315 # Default parameters #
316 ######################
318 gerrit_sonar_triggers:
319 - comment-added-contains-event:
320 comment-contains-value: run-sonar$
322 #####################
323 # Job Configuration #
324 #####################
327 - lf-infra-gerrit-scm:
328 jenkins-ssh-credential: '{jenkins-ssh-credential}'
330 refspec: $GERRIT_REFSPEC
331 branch: $GERRIT_BRANCH
332 submodule-recursive: '{submodule-recursive}'
333 submodule-timeout: '{submodule-timeout}'
334 submodule-disable: '{submodule-disable}'
335 choosing-strategy: default
338 - timed: '{obj:cron}'
340 server-name: '{gerrit-server-name}'
341 trigger-on: '{obj:gerrit_sonar_triggers}'
343 - project-compare-type: 'ANT'
344 project-pattern: '{project}'
346 - branch-compare-type: 'ANT'
347 branch-pattern: '**/{branch}'
348 file-paths: '{obj:gerrit_trigger_file_paths}'
356 name: '{project-name}-tox-sonar'
358 <<: *lf_python_common
359 # yamllint disable-line rule:key-duplicates
363 - lf-infra-properties:
364 build-days-to-keep: '{build-days-to-keep}'
366 url: '{github-url}/{github-org}/{project}'
369 - lf-infra-github-scm:
370 url: '{git-clone-url}{github-org}/{project}'
371 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
373 submodule-recursive: '{submodule-recursive}'
374 submodule-timeout: '{submodule-timeout}'
375 submodule-disable: '{submodule-disable}'
376 choosing-strategy: default
377 jenkins-ssh-credential: '{jenkins-ssh-credential}'
380 - github-pull-request:
381 trigger-phrase: '^run-sonar$'
382 only-trigger-phrase: false
383 status-context: 'Python Sonar'
386 white-list-target-branches:
388 included-regions: '{obj:github_included_regions}'
394 - lf_tox_verify: &lf_tox_verify
397 ######################
398 # Default parameters #
399 ######################
402 build-days-to-keep: 7
405 git-url: '$GIT_URL/$GERRIT_PROJECT'
406 github-url: 'https://github.com'
408 python-version: python2
410 submodule-recursive: true
411 submodule-timeout: 10
412 submodule-disable: false
416 gerrit_trigger_file_paths:
417 - compare-type: REG_EXP
420 # github_included_regions MUST match gerrit_trigger_file_paths
421 github_included_regions:
424 #####################
425 # Job Configuration #
426 #####################
428 project-type: freestyle
431 disabled: '{disable-job}'
434 - lf-infra-properties:
435 build-days-to-keep: '{build-days-to-keep}'
438 - lf-infra-parameters:
442 - lf-infra-tox-parameters:
444 tox-envs: '{tox-envs}'
447 default: '{parallel}'
448 description: Tox test type used to configure serial or parallel testing.
452 build-timeout: '{build-timeout}'
453 jenkins-ssh-credential: '{jenkins-ssh-credential}'
457 - lf-infra-tox-install:
458 python-version: '{python-version}'
459 - shell: !include-raw-escape: ../shell/tox-run.sh
465 # Python projects typically use tox to run testing.
466 name: '{project-name}-tox-verify-{stream}'
467 id: gerrit-tox-verify
470 ######################
471 # Default parameters #
472 ######################
474 gerrit-skip-vote: false
475 gerrit_verify_triggers:
476 - patchset-created-event:
478 exclude-trivial-rebase: false
479 exclude-no-code-change: false
480 - draft-published-event
481 - comment-added-contains-event:
482 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
484 #####################
485 # Job Configuration #
486 #####################
489 - lf-infra-gerrit-scm:
490 jenkins-ssh-credential: '{jenkins-ssh-credential}'
492 refspec: '$GERRIT_REFSPEC'
493 branch: '$GERRIT_BRANCH'
494 submodule-recursive: '{submodule-recursive}'
495 submodule-timeout: '{submodule-timeout}'
496 submodule-disable: '{submodule-disable}'
497 choosing-strategy: gerrit
501 server-name: '{gerrit-server-name}'
502 trigger-on: '{obj:gerrit_verify_triggers}'
504 - project-compare-type: ANT
505 project-pattern: '{project}'
507 - branch-compare-type: ANT
508 branch-pattern: '**/{branch}'
509 file-paths: '{obj:gerrit_trigger_file_paths}'
511 successful: '{gerrit-skip-vote}'
512 failed: '{gerrit-skip-vote}'
513 unstable: '{gerrit-skip-vote}'
514 notbuilt: '{gerrit-skip-vote}'
517 # Python projects typically use tox to run testing.
518 name: '{project-name}-tox-verify-{stream}'
519 id: github-tox-verify
523 - lf-infra-properties:
524 build-days-to-keep: '{build-days-to-keep}'
526 url: '{github-url}/{github-org}/{project}'
529 - lf-infra-github-scm:
530 url: '{git-clone-url}{github-org}/{project}'
531 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
533 submodule-recursive: '{submodule-recursive}'
534 submodule-timeout: '{submodule-timeout}'
535 submodule-disable: '{submodule-disable}'
536 choosing-strategy: default
537 jenkins-ssh-credential: '{jenkins-ssh-credential}'
540 - github-pull-request:
541 trigger-phrase: '^(recheck|reverify)$'
542 only-trigger-phrase: false
543 status-context: 'Tox Verify'
546 white-list-target-branches:
548 included-regions: '{obj:github_included_regions}'