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
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: run-clm$
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 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 submodule-timeout: '{submodule-timeout}'
189 choosing-strategy: default
190 jenkins-ssh-credential: '{jenkins-ssh-credential}'
193 # Build weekly on Saturdays
195 - github-pull-request:
196 trigger-phrase: '^run-clm$'
197 only-trigger-phrase: false
198 status-context: 'CLM'
201 white-list-target-branches:
203 included-regions: '{obj:github_included_regions}'
205 ########################
206 # Python Sonar with Tox #
207 ########################
209 - lf_tox_sonar: &lf_tox_sonar
212 ######################
213 # Default parameters #
214 ######################
216 branch: master # Sonar should always be run on master branch
217 build-days-to-keep: 7
219 cron: 'H H * * *' # run daily
221 git-url: '$GIT_URL/$PROJECT'
222 github-url: 'https://github.com'
223 java-version: openjdk8
224 python-version: python2
225 mvn-global-settings: global-settings
226 mvn-settings: '{mvn-settings}'
228 sonar-mvn-goal: 'sonar:sonar'
230 submodule-recursive: true
231 submodule-timeout: 10
233 gerrit_trigger_file_paths:
234 - compare-type: REG_EXP
237 # github_included_regions MUST match gerrit_trigger_file_paths
238 github_included_regions:
241 #####################
242 # Job Configuration #
243 #####################
245 disabled: '{disable-job}'
248 - lf-infra-parameters:
253 name: ARCHIVE_ARTIFACTS
254 default: '{archive-artifacts}'
255 description: Artifacts to archive to the logs server.
258 # Sets an env var for shell scripts to be able to call the dynamically
259 # installed maven without having to calculate the path themselves.
260 # yamllint disable-line rule:line-length
261 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
262 description: 'Maven selector to be used by shell scripts'
264 name: SONAR_MAVEN_GOAL
265 default: '{sonar-mvn-goal}'
267 Maven goals to pass to the Sonar call. Typically sonar:sonar
268 however to use a specific version of the sonar-maven-plugin we
269 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
273 - lf-infra-tox-install:
274 python-version: '{python-version}'
275 - shell: !include-raw-escape: ../shell/tox-run.sh
276 - lf-provide-maven-settings:
277 global-settings-file: '{mvn-global-settings}'
278 settings-file: '{mvn-settings}'
279 - lf-infra-tox-sonar:
280 java-version: '{java-version}'
281 mvn-settings: '{mvn-settings}'
282 mvn-version: '{mvn-version}'
288 name: lf-infra-tox-sonar
289 # Run a Sonar build with Maven
292 mvn-version: '{mvn-version}'
293 - lf-update-java-alternatives:
294 java-version: '{java-version}'
296 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
297 properties-content: SONAR_HOST_URL=$SONAR_URL
298 - shell: !include-raw-escape:
299 - ../shell/common-variables.sh
300 - ../shell/maven-sonar.sh
301 - lf-provide-maven-settings-cleanup
304 name: '{project-name}-tox-sonar'
306 <<: *lf_python_common
307 # yamllint disable-line rule:key-duplicates
310 ######################
311 # Default parameters #
312 ######################
314 gerrit_sonar_triggers:
315 - comment-added-contains-event:
316 comment-contains-value: run-sonar$
318 #####################
319 # Job Configuration #
320 #####################
323 - lf-infra-gerrit-scm:
324 jenkins-ssh-credential: '{jenkins-ssh-credential}'
326 refspec: $GERRIT_REFSPEC
327 branch: $GERRIT_BRANCH
328 submodule-recursive: '{submodule-recursive}'
329 submodule-timeout: '{submodule-timeout}'
330 choosing-strategy: default
333 - timed: '{obj:cron}'
335 server-name: '{gerrit-server-name}'
336 trigger-on: '{obj:gerrit_sonar_triggers}'
338 - project-compare-type: 'ANT'
339 project-pattern: '{project}'
341 - branch-compare-type: 'ANT'
342 branch-pattern: '**/{branch}'
343 file-paths: '{obj:gerrit_trigger_file_paths}'
351 name: '{project-name}-tox-sonar'
353 <<: *lf_python_common
354 # yamllint disable-line rule:key-duplicates
358 - lf-infra-properties:
359 build-days-to-keep: '{build-days-to-keep}'
361 url: '{github-url}/{github-org}/{project}'
364 - lf-infra-github-scm:
365 url: '{git-clone-url}{github-org}/{project}'
366 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
368 submodule-recursive: '{submodule-recursive}'
369 submodule-timeout: '{submodule-timeout}'
370 choosing-strategy: default
371 jenkins-ssh-credential: '{jenkins-ssh-credential}'
374 - github-pull-request:
375 trigger-phrase: '^run-sonar$'
376 only-trigger-phrase: false
377 status-context: 'Python Sonar'
380 white-list-target-branches:
382 included-regions: '{obj:github_included_regions}'
388 - lf_tox_verify: &lf_tox_verify
391 ######################
392 # Default parameters #
393 ######################
396 build-days-to-keep: 7
399 git-url: '$GIT_URL/$GERRIT_PROJECT'
400 github-url: 'https://github.com'
402 python-version: python2
404 submodule-recursive: true
405 submodule-timeout: 10
409 gerrit_trigger_file_paths:
410 - compare-type: REG_EXP
413 # github_included_regions MUST match gerrit_trigger_file_paths
414 github_included_regions:
417 #####################
418 # Job Configuration #
419 #####################
421 project-type: freestyle
424 disabled: '{disable-job}'
427 - lf-infra-properties:
428 build-days-to-keep: '{build-days-to-keep}'
431 - lf-infra-parameters:
435 - lf-infra-tox-parameters:
437 tox-envs: '{tox-envs}'
440 default: '{parallel}'
441 description: Tox test type used to configure serial or parallel testing.
445 build-timeout: '{build-timeout}'
446 jenkins-ssh-credential: '{jenkins-ssh-credential}'
450 - lf-infra-tox-install:
451 python-version: '{python-version}'
452 - shell: !include-raw-escape: ../shell/tox-run.sh
458 # Python projects typically use tox to run testing.
459 name: '{project-name}-tox-verify-{stream}'
460 id: gerrit-tox-verify
463 ######################
464 # Default parameters #
465 ######################
467 gerrit_verify_triggers:
468 - patchset-created-event:
470 exclude-trivial-rebase: false
471 exclude-no-code-change: false
472 - draft-published-event
473 - comment-added-contains-event:
474 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
476 #####################
477 # Job Configuration #
478 #####################
481 - lf-infra-gerrit-scm:
482 jenkins-ssh-credential: '{jenkins-ssh-credential}'
484 refspec: '$GERRIT_REFSPEC'
485 branch: '$GERRIT_BRANCH'
486 submodule-recursive: '{submodule-recursive}'
487 submodule-timeout: '{submodule-timeout}'
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}'
503 # Python projects typically use tox to run testing.
504 name: '{project-name}-tox-verify-{stream}'
505 id: github-tox-verify
509 - lf-infra-properties:
510 build-days-to-keep: '{build-days-to-keep}'
512 url: '{github-url}/{github-org}/{project}'
515 - lf-infra-github-scm:
516 url: '{git-clone-url}{github-org}/{project}'
517 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
519 submodule-recursive: '{submodule-recursive}'
520 submodule-timeout: '{submodule-timeout}'
521 choosing-strategy: default
522 jenkins-ssh-credential: '{jenkins-ssh-credential}'
525 - github-pull-request:
526 trigger-phrase: '^(recheck|reverify)$'
527 only-trigger-phrase: false
528 status-context: 'Tox Verify'
531 white-list-target-branches:
533 included-regions: '{obj:github_included_regions}'