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:
52 lftools-version: '{lftools-version}'
56 build-timeout: '{build-timeout}'
57 jenkins-ssh-credential: '{jenkins-ssh-credential}'
66 - lf_python_clm_xc: &lf_python_xc_clm
67 name: lf-python-xc-clm
69 ######################
70 # Default parameters #
71 ######################
74 build-days-to-keep: 30 # 30 days for troubleshooting purposes
77 git-url: '$GIT_URL/$PROJECT'
78 github-url: 'https://github.com'
79 java-version: openjdk8
80 nexus-iq-cli-version: 1.44.0-01
82 submodule-recursive: true
84 gerrit_trigger_file_paths:
88 # github_included_regions MUST match gerrit_trigger_file_paths
89 github_included_regions:
96 disabled: '{disable-job}'
99 - lf-infra-parameters:
103 lftools-version: '{lftools-version}'
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: '{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 choosing-strategy: default
150 # Build weekly on Saturdays
153 server-name: '{gerrit-server-name}'
154 trigger-on: '{obj:gerrit_clm_triggers}'
156 - project-compare-type: ANT
157 project-pattern: '{project}'
159 - branch-compare-type: ANT
160 branch-pattern: '**/{branch}'
161 file-paths: '{obj:gerrit_trigger_file_paths}'
169 name: '{project-name}-python-clm-{stream}'
170 id: github-python-xc-clm
171 <<: *lf_python_common
172 # yamllint disable-line rule:key-duplicates
173 <<: *lf_python_xc_clm
176 - lf-infra-properties:
177 build-days-to-keep: '{build-days-to-keep}'
179 url: '{github-url}/{github-org}/{project}'
182 - lf-infra-github-scm:
183 url: '{git-clone-url}{github-org}/{project}'
185 branch: 'refs/heads/{branch}'
186 submodule-recursive: '{submodule-recursive}'
187 choosing-strategy: default
188 jenkins-ssh-credential: '{jenkins-ssh-credential}'
191 # Build weekly on Saturdays
193 - github-pull-request:
194 trigger-phrase: '^run-clm$'
195 only-trigger-phrase: false
196 status-context: 'CLM'
199 white-list-target-branches:
201 included-regions: '{obj:github_included_regions}'
203 ########################
204 # Python Sonar with Tox #
205 ########################
207 - lf_tox_sonar: &lf_tox_sonar
210 ######################
211 # Default parameters #
212 ######################
214 branch: master # Sonar should always be run on master branch
215 build-days-to-keep: 7
217 cron: 'H H * * *' # run daily
219 git-url: '$GIT_URL/$PROJECT'
220 github-url: 'https://github.com'
221 java-version: openjdk8
222 python-version: python2
223 mvn-global-settings: global-settings
224 mvn-settings: '{mvn-settings}'
226 sonar-mvn-goal: 'sonar:sonar'
228 submodule-recursive: true
230 gerrit_trigger_file_paths:
231 - compare-type: REG_EXP
234 # github_included_regions MUST match gerrit_trigger_file_paths
235 github_included_regions:
238 #####################
239 # Job Configuration #
240 #####################
242 disabled: '{disable-job}'
245 - lf-infra-parameters:
249 lftools-version: '{lftools-version}'
251 name: ARCHIVE_ARTIFACTS
252 default: '{archive-artifacts}'
253 description: Artifacts to archive to the logs server.
256 # Sets an env var for shell scripts to be able to call the dynamically
257 # installed maven without having to calculate the path themselves.
258 # yamllint disable-line rule:line-length
259 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
260 description: 'Maven selector to be used by shell scripts'
262 name: SONAR_MAVEN_GOAL
263 default: '{sonar-mvn-goal}'
265 Maven goals to pass to the Sonar call. Typically sonar:sonar
266 however to use a specific version of the sonar-maven-plugin we
267 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
270 - shell: !include-raw-escape:
271 # Workaround issue where the tox run later breaks the lftools virtualenv.
272 # Without running the install first the run in the publisher will fail
273 # due to missing lftools because it gets installed into a tox venv.
274 - ../shell/lftools-install.sh
275 - lf-infra-tox-install:
276 python-version: '{python-version}'
277 - shell: !include-raw-escape: ../shell/tox-run.sh
278 - lf-provide-maven-settings:
279 global-settings-file: '{mvn-global-settings}'
280 settings-file: '{mvn-settings}'
281 - lf-infra-tox-sonar:
282 java-version: '{java-version}'
283 mvn-settings: '{mvn-settings}'
284 mvn-version: '{mvn-version}'
290 name: lf-infra-tox-sonar
291 # Run a Sonar build with Maven
294 mvn-version: '{mvn-version}'
295 - lf-update-java-alternatives:
296 java-version: '{java-version}'
298 # TODO: Switch this to the sonar wrapper when JJB 2.0 is available
299 properties-content: SONAR_HOST_URL=$SONAR_URL
300 - shell: !include-raw-escape:
301 - ../shell/common-variables.sh
302 - ../shell/maven-sonar.sh
303 - lf-provide-maven-settings-cleanup
306 name: '{project-name}-tox-sonar'
308 <<: *lf_python_common
309 # yamllint disable-line rule:key-duplicates
312 ######################
313 # Default parameters #
314 ######################
316 gerrit_sonar_triggers:
317 - comment-added-contains-event:
318 comment-contains-value: run-sonar$
320 #####################
321 # Job Configuration #
322 #####################
325 - lf-infra-gerrit-scm:
326 jenkins-ssh-credential: '{jenkins-ssh-credential}'
328 refspec: $GERRIT_REFSPEC
329 branch: $GERRIT_BRANCH
330 submodule-recursive: '{submodule-recursive}'
331 choosing-strategy: default
334 - timed: '{obj:cron}'
336 server-name: '{gerrit-server-name}'
337 trigger-on: '{obj:gerrit_sonar_triggers}'
339 - project-compare-type: 'ANT'
340 project-pattern: '{project}'
342 - branch-compare-type: 'ANT'
343 branch-pattern: '**/{branch}'
344 file-paths: '{obj:gerrit_trigger_file_paths}'
352 name: '{project-name}-tox-sonar'
354 <<: *lf_python_common
355 # yamllint disable-line rule:key-duplicates
359 - lf-infra-properties:
360 build-days-to-keep: '{build-days-to-keep}'
362 url: '{github-url}/{github-org}/{project}'
365 - lf-infra-github-scm:
366 url: '{git-clone-url}{github-org}/{project}'
367 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
369 submodule-recursive: '{submodule-recursive}'
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
408 gerrit_trigger_file_paths:
409 - compare-type: REG_EXP
412 # github_included_regions MUST match gerrit_trigger_file_paths
413 github_included_regions:
416 #####################
417 # Job Configuration #
418 #####################
420 project-type: freestyle
423 disabled: '{disable-job}'
426 - lf-infra-properties:
427 build-days-to-keep: '{build-days-to-keep}'
430 - lf-infra-parameters:
434 lftools-version: '{lftools-version}'
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 choosing-strategy: gerrit
491 server-name: '{gerrit-server-name}'
492 trigger-on: '{obj:gerrit_verify_triggers}'
494 - project-compare-type: ANT
495 project-pattern: '{project}'
497 - branch-compare-type: ANT
498 branch-pattern: '**/{branch}'
499 file-paths: '{obj:gerrit_trigger_file_paths}'
502 # Python projects typically use tox to run testing.
503 name: '{project-name}-tox-verify-{stream}'
504 id: github-tox-verify
508 - lf-infra-properties:
509 build-days-to-keep: '{build-days-to-keep}'
511 url: '{github-url}/{github-org}/{project}'
514 - lf-infra-github-scm:
515 url: '{git-clone-url}{github-org}/{project}'
516 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
518 submodule-recursive: '{submodule-recursive}'
519 choosing-strategy: default
520 jenkins-ssh-credential: '{jenkins-ssh-credential}'
523 - github-pull-request:
524 trigger-phrase: '^(recheck|reverify)$'
525 only-trigger-phrase: false
526 status-context: 'Tox Verify'
529 white-list-target-branches:
531 included-regions: '{obj:github_included_regions}'