7 name: lf-infra-tox-install
10 properties-content: "PYTHON_VERSION={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-
81 submodule-recursive: true
83 submodule-disable: false
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:
105 name: NEXUS_IQ_CLI_VERSION
106 default: "{nexus-iq-cli-version}"
107 description: Nexus IQ CLI package to download and use.
110 - credentials-binding:
111 - username-password-separated:
112 credential-id: nexus-iq-xc-clm
114 password: CLM_PASSWORD
116 - lf-update-java-alternatives:
117 java-version: "{java-version}"
118 - lf-infra-clm-python:
119 clm-project-name: "{nexus-iq-namespace}{project-name}"
122 name: "{project-name}-python-clm-{stream}"
123 id: gerrit-python-xc-clm
124 <<: *lf_python_common
125 # yamllint disable-line rule:key-duplicates
126 <<: *lf_python_xc_clm
128 ######################
129 # Default parameters #
130 ######################
133 - comment-added-contains-event:
134 comment-contains-value: '^Patch Set\s+\d+:\s+run-clm\s*$'
136 #####################
137 # Job Configuration #
138 #####################
141 - lf-infra-gerrit-scm:
142 jenkins-ssh-credential: "{jenkins-ssh-credential}"
144 refspec: "$GERRIT_REFSPEC"
145 branch: "$GERRIT_BRANCH"
146 submodule-recursive: "{submodule-recursive}"
147 submodule-timeout: "{submodule-timeout}"
148 submodule-disable: "{submodule-disable}"
149 choosing-strategy: default
152 # Build weekly on Saturdays
155 server-name: "{gerrit-server-name}"
156 trigger-on: "{obj:gerrit_clm_triggers}"
158 - project-compare-type: ANT
159 project-pattern: "{project}"
161 - branch-compare-type: ANT
162 branch-pattern: "**/{branch}"
163 file-paths: "{obj:gerrit_trigger_file_paths}"
171 name: "{project-name}-python-clm-{stream}"
172 id: github-python-xc-clm
173 <<: *lf_python_common
174 # yamllint disable-line rule:key-duplicates
175 <<: *lf_python_xc_clm
178 - lf-infra-properties:
179 build-days-to-keep: "{build-days-to-keep}"
181 url: "{github-url}/{github-org}/{project}"
184 - lf-infra-github-scm:
185 url: "{git-clone-url}{github-org}/{project}"
187 branch: "refs/heads/{branch}"
188 submodule-recursive: "{submodule-recursive}"
189 submodule-timeout: "{submodule-timeout}"
190 submodule-disable: "{submodule-disable}"
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
234 submodule-disable: false
236 gerrit_trigger_file_paths:
237 - compare-type: REG_EXP
240 # github_included_regions MUST match gerrit_trigger_file_paths
241 github_included_regions:
244 #####################
245 # Job Configuration #
246 #####################
248 disabled: "{disable-job}"
251 - lf-infra-parameters:
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: '^Patch Set\s+\d+:\s+run-sonar\s*$'
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 submodule-disable: "{submodule-disable}"
334 choosing-strategy: default
337 - timed: "{obj:cron}"
339 server-name: "{gerrit-server-name}"
340 trigger-on: "{obj:gerrit_sonar_triggers}"
342 - project-compare-type: "ANT"
343 project-pattern: "{project}"
345 - branch-compare-type: "ANT"
346 branch-pattern: "**/{branch}"
347 file-paths: "{obj:gerrit_trigger_file_paths}"
355 name: "{project-name}-tox-sonar"
357 <<: *lf_python_common
358 # yamllint disable-line rule:key-duplicates
362 - lf-infra-properties:
363 build-days-to-keep: "{build-days-to-keep}"
365 url: "{github-url}/{github-org}/{project}"
368 - lf-infra-github-scm:
369 url: "{git-clone-url}{github-org}/{project}"
370 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
372 submodule-recursive: "{submodule-recursive}"
373 submodule-timeout: "{submodule-timeout}"
374 submodule-disable: "{submodule-disable}"
375 choosing-strategy: default
376 jenkins-ssh-credential: "{jenkins-ssh-credential}"
379 - github-pull-request:
380 trigger-phrase: "^run-sonar$"
381 only-trigger-phrase: false
382 status-context: "Python Sonar"
385 white-list-target-branches:
387 included-regions: "{obj:github_included_regions}"
393 - lf_tox_verify: &lf_tox_verify
396 ######################
397 # Default parameters #
398 ######################
401 build-days-to-keep: 7
404 git-url: "$GIT_URL/$GERRIT_PROJECT"
405 github-url: "https://github.com"
407 python-version: python2
409 submodule-recursive: true
410 submodule-timeout: 10
411 submodule-disable: false
415 gerrit_trigger_file_paths:
416 - compare-type: REG_EXP
419 # github_included_regions MUST match gerrit_trigger_file_paths
420 github_included_regions:
423 #####################
424 # Job Configuration #
425 #####################
427 project-type: freestyle
430 disabled: "{disable-job}"
433 - lf-infra-properties:
434 build-days-to-keep: "{build-days-to-keep}"
437 - lf-infra-parameters:
441 - lf-infra-tox-parameters:
443 tox-envs: "{tox-envs}"
446 default: "{parallel}"
447 description: Tox test type used to configure serial or parallel testing.
451 build-timeout: "{build-timeout}"
452 jenkins-ssh-credential: "{jenkins-ssh-credential}"
456 - lf-infra-tox-install:
457 python-version: "{python-version}"
458 - shell: !include-raw-escape: ../shell/tox-run.sh
464 # Python projects typically use tox to run testing.
465 name: "{project-name}-tox-verify-{stream}"
466 id: gerrit-tox-verify
469 ######################
470 # Default parameters #
471 ######################
473 gerrit-skip-vote: false
474 gerrit_verify_triggers:
475 - patchset-created-event:
477 exclude-trivial-rebase: false
478 exclude-no-code-change: false
479 - draft-published-event
480 - comment-added-contains-event:
481 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
483 #####################
484 # Job Configuration #
485 #####################
488 - lf-infra-gerrit-scm:
489 jenkins-ssh-credential: "{jenkins-ssh-credential}"
491 refspec: "$GERRIT_REFSPEC"
492 branch: "$GERRIT_BRANCH"
493 submodule-recursive: "{submodule-recursive}"
494 submodule-timeout: "{submodule-timeout}"
495 submodule-disable: "{submodule-disable}"
496 choosing-strategy: gerrit
500 server-name: "{gerrit-server-name}"
501 trigger-on: "{obj:gerrit_verify_triggers}"
503 - project-compare-type: ANT
504 project-pattern: "{project}"
506 - branch-compare-type: ANT
507 branch-pattern: "**/{branch}"
508 file-paths: "{obj:gerrit_trigger_file_paths}"
510 successful: "{gerrit-skip-vote}"
511 failed: "{gerrit-skip-vote}"
512 unstable: "{gerrit-skip-vote}"
513 notbuilt: "{gerrit-skip-vote}"
516 # Python projects typically use tox to run testing.
517 name: "{project-name}-tox-verify-{stream}"
518 id: github-tox-verify
522 - lf-infra-properties:
523 build-days-to-keep: "{build-days-to-keep}"
525 url: "{github-url}/{github-org}/{project}"
528 - lf-infra-github-scm:
529 url: "{git-clone-url}{github-org}/{project}"
530 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
532 submodule-recursive: "{submodule-recursive}"
533 submodule-timeout: "{submodule-timeout}"
534 submodule-disable: "{submodule-disable}"
535 choosing-strategy: default
536 jenkins-ssh-credential: "{jenkins-ssh-credential}"
539 - github-pull-request:
540 trigger-phrase: "^(recheck|reverify)$"
541 only-trigger-phrase: false
542 status-context: "Tox Verify"
545 white-list-target-branches:
547 included-regions: "{obj:github_included_regions}"