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-
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 pre-build-script: "# pre-build script goes here"
229 python-version: python2
230 mvn-global-settings: global-settings
231 mvn-settings: "{mvn-settings}"
233 sonar-mvn-goal: "sonar:sonar"
235 submodule-recursive: true
236 submodule-timeout: 10
237 submodule-disable: false
239 gerrit_trigger_file_paths:
240 - compare-type: REG_EXP
243 # github_included_regions MUST match gerrit_trigger_file_paths
244 github_included_regions:
247 #####################
248 # Job Configuration #
249 #####################
251 disabled: "{disable-job}"
254 - lf-infra-parameters:
259 name: ARCHIVE_ARTIFACTS
260 default: "{archive-artifacts}"
261 description: Artifacts to archive to the logs server.
264 # Sets an env var for shell scripts to be able to call the dynamically
265 # installed maven without having to calculate the path themselves.
266 # yamllint disable-line rule:line-length
267 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
268 description: "Maven selector to be used by shell scripts"
270 name: SONAR_MAVEN_GOAL
271 default: "{sonar-mvn-goal}"
273 Maven goals to pass to the Sonar call. Typically sonar:sonar
274 however to use a specific version of the sonar-maven-plugin we
275 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
279 - lf-infra-tox-install:
280 python-version: "{python-version}"
281 - shell: "{pre-build-script}"
282 - shell: !include-raw-escape: ../shell/tox-run.sh
283 - lf-provide-maven-settings:
284 global-settings-file: "{mvn-global-settings}"
285 settings-file: "{mvn-settings}"
286 - lf-infra-tox-sonar:
287 java-version: "{java-version}"
288 mvn-settings: "{mvn-settings}"
289 mvn-version: "{mvn-version}"
295 name: lf-infra-tox-sonar
296 # Run a Sonar build with Maven
299 mvn-version: "{mvn-version}"
300 - lf-update-java-alternatives:
301 java-version: "{java-version}"
303 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
304 properties-content: SONAR_HOST_URL=$SONAR_URL
305 - shell: !include-raw-escape:
306 - ../shell/common-variables.sh
307 - ../shell/maven-sonar.sh
308 - lf-provide-maven-settings-cleanup
311 name: "{project-name}-tox-sonar"
313 <<: *lf_python_common
314 # yamllint disable-line rule:key-duplicates
317 ######################
318 # Default parameters #
319 ######################
321 gerrit_sonar_triggers:
322 - comment-added-contains-event:
323 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
325 #####################
326 # Job Configuration #
327 #####################
330 - lf-infra-gerrit-scm:
331 jenkins-ssh-credential: "{jenkins-ssh-credential}"
333 refspec: $GERRIT_REFSPEC
334 branch: $GERRIT_BRANCH
335 submodule-recursive: "{submodule-recursive}"
336 submodule-timeout: "{submodule-timeout}"
337 submodule-disable: "{submodule-disable}"
338 choosing-strategy: default
341 - timed: "{obj:cron}"
343 server-name: "{gerrit-server-name}"
344 trigger-on: "{obj:gerrit_sonar_triggers}"
346 - project-compare-type: "ANT"
347 project-pattern: "{project}"
349 - branch-compare-type: "ANT"
350 branch-pattern: "**/{branch}"
351 file-paths: "{obj:gerrit_trigger_file_paths}"
359 name: "{project-name}-tox-sonar"
361 <<: *lf_python_common
362 # yamllint disable-line rule:key-duplicates
366 - lf-infra-properties:
367 build-days-to-keep: "{build-days-to-keep}"
369 url: "{github-url}/{github-org}/{project}"
372 - lf-infra-github-scm:
373 url: "{git-clone-url}{github-org}/{project}"
374 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
376 submodule-recursive: "{submodule-recursive}"
377 submodule-timeout: "{submodule-timeout}"
378 submodule-disable: "{submodule-disable}"
379 choosing-strategy: default
380 jenkins-ssh-credential: "{jenkins-ssh-credential}"
383 - github-pull-request:
384 trigger-phrase: "^run-sonar$"
385 only-trigger-phrase: false
386 status-context: "Python Sonar"
389 white-list-target-branches:
391 included-regions: "{obj:github_included_regions}"
397 - lf_tox_verify: &lf_tox_verify
400 ######################
401 # Default parameters #
402 ######################
405 build-days-to-keep: 7
408 git-url: "$GIT_URL/$GERRIT_PROJECT"
409 github-url: "https://github.com"
411 pre-build-script: "# pre-build script goes here"
412 python-version: python2
414 submodule-recursive: true
415 submodule-timeout: 10
416 submodule-disable: false
420 gerrit_trigger_file_paths:
421 - compare-type: REG_EXP
424 # github_included_regions MUST match gerrit_trigger_file_paths
425 github_included_regions:
428 #####################
429 # Job Configuration #
430 #####################
432 project-type: freestyle
435 disabled: "{disable-job}"
438 - lf-infra-properties:
439 build-days-to-keep: "{build-days-to-keep}"
442 - lf-infra-parameters:
446 - lf-infra-tox-parameters:
448 tox-envs: "{tox-envs}"
451 default: "{parallel}"
452 description: Tox test type used to configure serial or parallel testing.
456 build-timeout: "{build-timeout}"
457 jenkins-ssh-credential: "{jenkins-ssh-credential}"
461 - lf-infra-tox-install:
462 python-version: "{python-version}"
463 - shell: "{pre-build-script}"
464 - shell: !include-raw-escape: ../shell/tox-run.sh
470 # Python projects typically use tox to run testing.
471 name: "{project-name}-tox-verify-{stream}"
472 id: gerrit-tox-verify
475 ######################
476 # Default parameters #
477 ######################
479 gerrit-skip-vote: false
480 gerrit_verify_triggers:
481 - patchset-created-event:
483 exclude-trivial-rebase: false
484 exclude-no-code-change: false
485 - draft-published-event
486 - comment-added-contains-event:
487 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
489 #####################
490 # Job Configuration #
491 #####################
494 - lf-infra-gerrit-scm:
495 jenkins-ssh-credential: "{jenkins-ssh-credential}"
497 refspec: "$GERRIT_REFSPEC"
498 branch: "$GERRIT_BRANCH"
499 submodule-recursive: "{submodule-recursive}"
500 submodule-timeout: "{submodule-timeout}"
501 submodule-disable: "{submodule-disable}"
502 choosing-strategy: gerrit
506 server-name: "{gerrit-server-name}"
507 trigger-on: "{obj:gerrit_verify_triggers}"
509 - project-compare-type: ANT
510 project-pattern: "{project}"
512 - branch-compare-type: ANT
513 branch-pattern: "**/{branch}"
514 file-paths: "{obj:gerrit_trigger_file_paths}"
516 successful: "{gerrit-skip-vote}"
517 failed: "{gerrit-skip-vote}"
518 unstable: "{gerrit-skip-vote}"
519 notbuilt: "{gerrit-skip-vote}"
522 # Python projects typically use tox to run testing.
523 name: "{project-name}-tox-verify-{stream}"
524 id: github-tox-verify
528 - lf-infra-properties:
529 build-days-to-keep: "{build-days-to-keep}"
531 url: "{github-url}/{github-org}/{project}"
534 - lf-infra-github-scm:
535 url: "{git-clone-url}{github-org}/{project}"
536 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
538 submodule-recursive: "{submodule-recursive}"
539 submodule-timeout: "{submodule-timeout}"
540 submodule-disable: "{submodule-disable}"
541 choosing-strategy: default
542 jenkins-ssh-credential: "{jenkins-ssh-credential}"
545 - github-pull-request:
546 trigger-phrase: "^(recheck|reverify)$"
547 only-trigger-phrase: false
548 status-context: "Tox Verify"
551 white-list-target-branches:
553 included-regions: "{obj:github_included_regions}"