7 name: lf-infra-tox-install
10 properties-content: "PYTHON={python-version}"
11 - shell: !include-raw-escape: ../shell/tox-install.sh
14 name: lf-infra-clm-python
17 properties-content: "CLM_PROJECT_NAME={clm-project-name}"
18 - shell: !include-raw-escape:
19 - ../shell/nexus-iq-cli.sh
25 - lf_python_common: &lf_python_common
26 name: lf-python-common
28 ######################
29 # Default parameters #
30 ######################
39 project-type: freestyle
43 - lf-infra-properties:
44 build-days-to-keep: "{build-days-to-keep}"
47 - lf-infra-parameters:
54 build-timeout: "{build-timeout}"
55 jenkins-ssh-credential: "{jenkins-ssh-credential}"
64 - lf_python_clm_xc: &lf_python_xc_clm
65 name: lf-python-xc-clm
67 ######################
68 # Default parameters #
69 ######################
72 build-days-to-keep: 30 # 30 days for troubleshooting purposes
75 git-url: "$GIT_URL/$PROJECT"
76 github-url: "https://github.com"
77 java-version: openjdk8
78 nexus-iq-cli-version: 1.44.0-01
79 nexus-iq-namespace: "" # Recommend a trailing dash when set. Example: odl-
80 pre-build-script: "# pre-build script goes here"
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 - shell: "{pre-build-script}"
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: '^Patch Set\s+\d+:\s+run-clm\s*$'
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 submodule-disable: "{submodule-disable}"
151 choosing-strategy: default
154 # Build weekly on Saturdays
157 server-name: "{gerrit-server-name}"
158 trigger-on: "{obj:gerrit_clm_triggers}"
160 - project-compare-type: ANT
161 project-pattern: "{project}"
163 - branch-compare-type: ANT
164 branch-pattern: "**/{branch}"
165 file-paths: "{obj:gerrit_trigger_file_paths}"
173 name: "{project-name}-python-clm-{stream}"
174 id: github-python-xc-clm
175 <<: *lf_python_common
176 # yamllint disable-line rule:key-duplicates
177 <<: *lf_python_xc_clm
180 - lf-infra-properties:
181 build-days-to-keep: "{build-days-to-keep}"
183 url: "{github-url}/{github-org}/{project}"
186 - lf-infra-github-scm:
187 url: "{git-clone-url}{github-org}/{project}"
189 branch: "refs/heads/{branch}"
190 submodule-recursive: "{submodule-recursive}"
191 submodule-timeout: "{submodule-timeout}"
192 submodule-disable: "{submodule-disable}"
193 choosing-strategy: default
194 jenkins-ssh-credential: "{jenkins-ssh-credential}"
197 # Build weekly on Saturdays
199 - github-pull-request:
200 trigger-phrase: "^run-clm$"
201 only-trigger-phrase: false
202 status-context: "CLM"
205 white-list-target-branches:
207 included-regions: "{obj:github_included_regions}"
209 #########################
210 # Python Sonar with Tox #
211 #########################
213 - lf_tox_sonar: &lf_tox_sonar
216 ######################
217 # Default parameters #
218 ######################
220 branch: master # Sonar should always be run on master branch
221 build-days-to-keep: 7
223 cron: "H H * * *" # run daily
225 git-url: "$GIT_URL/$PROJECT"
226 github-url: "https://github.com"
227 java-version: openjdk8
228 mvn-global-settings: global-settings
230 mvn-settings: "{mvn-settings}"
232 pre-build-script: "# pre-build script goes here"
233 python-version: python2
234 sonar-mvn-goal: "sonar:sonar"
236 submodule-recursive: true
237 submodule-timeout: 10
238 submodule-disable: false
240 gerrit_trigger_file_paths:
241 - compare-type: REG_EXP
244 # github_included_regions MUST match gerrit_trigger_file_paths
245 github_included_regions:
248 #####################
249 # Job Configuration #
250 #####################
252 disabled: "{disable-job}"
255 - lf-infra-parameters:
260 name: ARCHIVE_ARTIFACTS
261 default: "{archive-artifacts}"
262 description: Artifacts to archive to the logs server.
265 # Sets an env var for shell scripts to be able to call the dynamically
266 # installed maven without having to calculate the path themselves.
267 # yamllint disable-line rule:line-length
268 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
269 description: "Maven selector to be used by shell scripts"
271 name: SONAR_MAVEN_GOAL
272 default: "{sonar-mvn-goal}"
274 Maven goals to pass to the Sonar call. Typically sonar:sonar
275 however to use a specific version of the sonar-maven-plugin we
276 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
280 - lf-infra-tox-install:
281 python-version: "{python-version}"
282 - shell: "{pre-build-script}"
283 - shell: !include-raw-escape: ../shell/tox-run.sh
284 - lf-provide-maven-settings:
285 global-settings-file: "{mvn-global-settings}"
286 settings-file: "{mvn-settings}"
287 - lf-infra-maven-sonar:
288 java-version: "{java-version}"
289 mvn-goals: "{mvn-goals}"
290 mvn-settings: "{mvn-settings}"
291 mvn-version: "{mvn-version}"
297 name: "{project-name}-tox-sonar"
299 <<: *lf_python_common
300 # yamllint disable-line rule:key-duplicates
303 ######################
304 # Default parameters #
305 ######################
307 gerrit_sonar_triggers:
308 - comment-added-contains-event:
309 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
311 #####################
312 # Job Configuration #
313 #####################
316 - lf-infra-gerrit-scm:
317 jenkins-ssh-credential: "{jenkins-ssh-credential}"
319 refspec: $GERRIT_REFSPEC
320 branch: $GERRIT_BRANCH
321 submodule-recursive: "{submodule-recursive}"
322 submodule-timeout: "{submodule-timeout}"
323 submodule-disable: "{submodule-disable}"
324 choosing-strategy: default
327 - timed: "{obj:cron}"
329 server-name: "{gerrit-server-name}"
330 trigger-on: "{obj:gerrit_sonar_triggers}"
332 - project-compare-type: "ANT"
333 project-pattern: "{project}"
335 - branch-compare-type: "ANT"
336 branch-pattern: "**/{branch}"
337 file-paths: "{obj:gerrit_trigger_file_paths}"
345 name: "{project-name}-tox-sonar"
347 <<: *lf_python_common
348 # yamllint disable-line rule:key-duplicates
352 - lf-infra-properties:
353 build-days-to-keep: "{build-days-to-keep}"
355 url: "{github-url}/{github-org}/{project}"
358 - lf-infra-github-scm:
359 url: "{git-clone-url}{github-org}/{project}"
360 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
362 submodule-recursive: "{submodule-recursive}"
363 submodule-timeout: "{submodule-timeout}"
364 submodule-disable: "{submodule-disable}"
365 choosing-strategy: default
366 jenkins-ssh-credential: "{jenkins-ssh-credential}"
369 - github-pull-request:
370 trigger-phrase: "^run-sonar$"
371 only-trigger-phrase: false
372 status-context: "Python Sonar"
375 white-list-target-branches:
377 included-regions: "{obj:github_included_regions}"
383 - lf_tox_common: &lf_tox_common
386 ######################
387 # Default parameters #
388 ######################
391 build-days-to-keep: 7
394 git-url: "$GIT_URL/$GERRIT_PROJECT"
395 github-url: "https://github.com"
397 pre-build-script: "# pre-build script goes here"
398 python-version: python2
400 submodule-recursive: true
401 submodule-timeout: 10
402 submodule-disable: false
406 gerrit_trigger_file_paths:
407 - compare-type: REG_EXP
410 # github_included_regions MUST match gerrit_trigger_file_paths
411 github_included_regions:
414 #####################
415 # Job Configuration #
416 #####################
418 project-type: freestyle
421 disabled: "{disable-job}"
424 - lf-infra-properties:
425 build-days-to-keep: "{build-days-to-keep}"
428 - lf-infra-parameters:
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: "{pre-build-script}"
450 - shell: !include-raw-escape: ../shell/tox-run.sh
456 # Python projects typically use tox to run testing.
457 name: "{project-name}-tox-verify-{stream}"
458 id: gerrit-tox-verify
461 ######################
462 # Default parameters #
463 ######################
465 gerrit-skip-vote: false
466 gerrit_verify_triggers:
467 - patchset-created-event:
469 exclude-trivial-rebase: false
470 exclude-no-code-change: false
471 - draft-published-event
472 - comment-added-contains-event:
473 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
475 #####################
476 # Job Configuration #
477 #####################
480 - lf-infra-gerrit-scm:
481 jenkins-ssh-credential: "{jenkins-ssh-credential}"
483 refspec: "$GERRIT_REFSPEC"
484 branch: "$GERRIT_BRANCH"
485 submodule-recursive: "{submodule-recursive}"
486 submodule-timeout: "{submodule-timeout}"
487 submodule-disable: "{submodule-disable}"
488 choosing-strategy: gerrit
492 server-name: "{gerrit-server-name}"
493 trigger-on: "{obj:gerrit_verify_triggers}"
495 - project-compare-type: ANT
496 project-pattern: "{project}"
498 - branch-compare-type: ANT
499 branch-pattern: "**/{branch}"
500 file-paths: "{obj:gerrit_trigger_file_paths}"
502 successful: "{gerrit-skip-vote}"
503 failed: "{gerrit-skip-vote}"
504 unstable: "{gerrit-skip-vote}"
505 notbuilt: "{gerrit-skip-vote}"
508 # Python projects typically use tox to run testing.
509 name: "{project-name}-tox-verify-{stream}"
510 id: github-tox-verify
514 - lf-infra-properties:
515 build-days-to-keep: "{build-days-to-keep}"
517 url: "{github-url}/{github-org}/{project}"
520 - lf-infra-github-scm:
521 url: "{git-clone-url}{github-org}/{project}"
522 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
524 submodule-recursive: "{submodule-recursive}"
525 submodule-timeout: "{submodule-timeout}"
526 submodule-disable: "{submodule-disable}"
527 choosing-strategy: default
528 jenkins-ssh-credential: "{jenkins-ssh-credential}"
531 - github-pull-request:
532 trigger-phrase: "^(recheck|reverify)$"
533 only-trigger-phrase: false
534 status-context: "Tox Verify"
537 white-list-target-branches:
539 included-regions: "{obj:github_included_regions}"
542 # Run tox after merge of gerrit change set
543 name: "{project-name}-tox-merge-{stream}"
547 ######################
548 # Default parameters #
549 ######################
551 gerrit_merge_triggers:
552 - change-merged-event
553 - comment-added-contains-event:
554 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
556 #####################
557 # Job Configuration #
558 #####################
561 - lf-infra-gerrit-scm:
562 jenkins-ssh-credential: "{jenkins-ssh-credential}"
564 refspec: "$GERRIT_REFSPEC"
565 branch: "$GERRIT_BRANCH"
566 submodule-recursive: "{submodule-recursive}"
567 submodule-timeout: "{submodule-timeout}"
568 submodule-disable: "{submodule-disable}"
569 choosing-strategy: gerrit
573 server-name: "{gerrit-server-name}"
574 trigger-on: "{obj:gerrit_merge_triggers}"
576 - project-compare-type: ANT
577 project-pattern: "{project}"
579 - branch-compare-type: ANT
580 branch-pattern: "**/{branch}"
581 file-paths: "{obj:gerrit_trigger_file_paths}"
584 # Run tox after merge of github pull request
585 name: "{project-name}-tox-merge-{stream}"
590 - lf-infra-properties:
591 build-days-to-keep: "{build-days-to-keep}"
593 url: "{github-url}/{github-org}/{project}"
596 - lf-infra-github-scm:
597 url: "{git-clone-url}{github-org}/{project}"
599 branch: "refs/heads/{branch}"
600 submodule-recursive: "{submodule-recursive}"
601 submodule-timeout: "{submodule-timeout}"
602 submodule-disable: "{submodule-disable}"
603 choosing-strategy: default
604 jenkins-ssh-credential: "{jenkins-ssh-credential}"
607 - github-pull-request:
608 trigger-phrase: "^remerge$"
609 only-trigger-phrase: true
610 status-context: "Tox Merge"
615 white-list: "{obj:github_pr_whitelist}"
616 admin-list: "{obj:github_pr_admin_list}"
617 white-list-target-branches:
619 included-regions: "{obj:github_included_regions}"