7 name: lf-infra-clm-python
10 properties-content: "CLM_PROJECT_NAME={clm-project-name}"
11 - shell: !include-raw-escape: ../shell/nexus-iq-cli.sh
14 name: lf-infra-tox-install
17 properties-content: "PYTHON={python-version}"
18 - shell: !include-raw-escape: ../shell/tox-install.sh
21 name: lf-infra-tox-run
24 properties-content: "PARALLEL={parallel}"
25 - shell: !include-raw-escape: ../shell/tox-run.sh
31 - lf_python_common: &lf_python_common
32 name: lf-python-common
34 ######################
35 # Default parameters #
36 ######################
45 project-type: freestyle
49 - lf-infra-properties:
50 build-days-to-keep: "{build-days-to-keep}"
53 - lf-infra-parameters:
60 build-timeout: "{build-timeout}"
61 jenkins-ssh-credential: "{jenkins-ssh-credential}"
70 - lf_python_clm_xc: &lf_python_xc_clm
71 name: lf-python-xc-clm
73 ######################
74 # Default parameters #
75 ######################
78 build-days-to-keep: 30 # 30 days for troubleshooting purposes
81 git-url: "$GIT_URL/$PROJECT"
82 github-url: "https://github.com"
83 java-version: openjdk8
84 nexus-iq-cli-version: 1.44.0-01
85 nexus-iq-namespace: "" # Recommend a trailing dash when set. Example: odl-
86 pre-build-script: " # pre-build script goes here"
88 submodule-recursive: true
90 submodule-disable: false
92 gerrit_trigger_file_paths:
93 - compare-type: REG_EXP
96 # github_included_regions MUST match gerrit_trigger_file_paths
97 github_included_regions:
100 #####################
101 # Job Configuration #
102 #####################
104 disabled: "{disable-job}"
107 - lf-infra-parameters:
112 name: NEXUS_IQ_CLI_VERSION
113 default: "{nexus-iq-cli-version}"
114 description: Nexus IQ CLI package to download and use.
117 - credentials-binding:
118 - username-password-separated:
119 credential-id: nexus-iq-xc-clm
121 password: CLM_PASSWORD
123 - lf-update-java-alternatives:
124 java-version: "{java-version}"
125 - shell: "{pre-build-script}"
126 - lf-infra-clm-python:
127 clm-project-name: "{nexus-iq-namespace}{project-name}"
130 name: "{project-name}-python-clm-{stream}"
131 id: gerrit-python-xc-clm
132 <<: *lf_python_common
133 <<: *lf_python_xc_clm
135 ######################
136 # Default parameters #
137 ######################
140 - comment-added-contains-event:
141 comment-contains-value: '^Patch Set\s+\d+:\s+run-clm\s*$'
143 #####################
144 # Job Configuration #
145 #####################
148 - lf-infra-gerrit-scm:
149 jenkins-ssh-credential: "{jenkins-ssh-credential}"
151 refspec: "$GERRIT_REFSPEC"
152 branch: "$GERRIT_BRANCH"
153 submodule-recursive: "{submodule-recursive}"
154 submodule-timeout: "{submodule-timeout}"
155 submodule-disable: "{submodule-disable}"
156 choosing-strategy: default
159 # Build weekly on Saturdays
162 server-name: "{gerrit-server-name}"
163 trigger-on: "{obj:gerrit_clm_triggers}"
165 - project-compare-type: ANT
166 project-pattern: "{project}"
168 - branch-compare-type: ANT
169 branch-pattern: "**/{branch}"
170 file-paths: "{obj:gerrit_trigger_file_paths}"
178 name: "{project-name}-python-clm-{stream}"
179 id: github-python-xc-clm
180 <<: *lf_python_common
181 <<: *lf_python_xc_clm
184 - lf-infra-properties:
185 build-days-to-keep: "{build-days-to-keep}"
187 url: "{github-url}/{github-org}/{project}"
190 - lf-infra-github-scm:
191 url: "{git-clone-url}{github-org}/{project}"
193 branch: "refs/heads/{branch}"
194 submodule-recursive: "{submodule-recursive}"
195 submodule-timeout: "{submodule-timeout}"
196 submodule-disable: "{submodule-disable}"
197 choosing-strategy: default
198 jenkins-ssh-credential: "{jenkins-ssh-credential}"
201 # Build weekly on Saturdays
203 - github-pull-request:
204 trigger-phrase: "^run-clm$"
205 only-trigger-phrase: false
206 status-context: "CLM"
209 white-list-target-branches:
211 included-regions: "{obj:github_included_regions}"
213 #########################
214 # Python Sonar with Tox #
215 #########################
217 - lf_tox_sonar: &lf_tox_sonar
220 ######################
221 # Default parameters #
222 ######################
224 branch: master # Sonar should always be run on master branch
225 build-days-to-keep: 7
227 cron: "H H * * *" # run daily
229 git-url: "$GIT_URL/$PROJECT"
230 github-url: "https://github.com"
231 java-version: openjdk8
232 mvn-global-settings: global-settings
236 mvn-settings: "{mvn-settings}"
239 pre-build-script: "# pre-build script goes here"
240 python-version: python3
241 sonar-mvn-goal: "sonar:sonar"
243 sonarcloud-project-key: ""
244 sonarcloud-project-organization: ""
245 sonarcloud-api-token: ""
247 submodule-recursive: true
248 submodule-timeout: 10
249 submodule-disable: false
253 gerrit_trigger_file_paths:
254 - compare-type: REG_EXP
257 # github_included_regions MUST match gerrit_trigger_file_paths
258 github_included_regions:
261 #####################
262 # Job Configuration #
263 #####################
265 disabled: "{disable-job}"
268 - lf-infra-parameters:
272 - lf-infra-maven-parameters:
273 mvn-opts: "{mvn-opts}"
274 mvn-params: "{mvn-params}"
275 mvn-version: "{mvn-version}"
276 - lf-infra-tox-parameters:
278 tox-envs: "{tox-envs}"
280 name: ARCHIVE_ARTIFACTS
281 default: "{archive-artifacts}"
282 description: Artifacts to archive to the logs server.
285 # Sets an env var for shell scripts to be able to call the dynamically
286 # installed maven without having to calculate the path themselves.
287 # yamllint disable-line rule:line-length
288 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
289 description: "Maven selector to be used by shell scripts"
291 name: SONAR_MAVEN_GOAL
292 default: "{sonar-mvn-goal}"
294 Maven goals to pass to the Sonar call. Typically sonar:sonar
295 however to use a specific version of the sonar-maven-plugin we
296 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
300 - lf-infra-tox-install:
301 python-version: "{python-version}"
302 - shell: "{pre-build-script}"
304 parallel: "{parallel}"
305 - lf-provide-maven-settings:
306 global-settings-file: "{mvn-global-settings}"
307 settings-file: "{mvn-settings}"
310 condition-kind: boolean-expression
311 condition-expression: "{sonarcloud}"
313 - shell: echo 'Using SonarCloud'
314 - lf-infra-maven-sonarcloud:
315 java-version: "{java-version}"
316 mvn-goals: "{mvn-goals}"
317 mvn-settings: "{mvn-settings}"
318 mvn-version: "{mvn-version}"
319 sonarcloud-project-key: "{sonarcloud-project-key}"
320 # yamllint disable-line rule:line-length
321 sonarcloud-project-organization: "{sonarcloud-project-organization}"
322 sonarcloud-api-token: "{sonarcloud-api-token}"
327 condition-kind: boolean-expression
328 condition-expression: "{sonarcloud}"
330 - shell: echo 'Using SonarQube'
331 - lf-infra-maven-sonar:
332 java-version: "{java-version}"
333 mvn-goals: "{mvn-goals}"
334 mvn-settings: "{mvn-settings}"
335 mvn-version: "{mvn-version}"
341 name: "{project-name}-tox-sonar"
343 <<: *lf_python_common
346 ######################
347 # Default parameters #
348 ######################
350 gerrit_sonar_triggers:
351 - comment-added-contains-event:
352 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
354 #####################
355 # Job Configuration #
356 #####################
359 - lf-infra-gerrit-scm:
360 jenkins-ssh-credential: "{jenkins-ssh-credential}"
362 refspec: $GERRIT_REFSPEC
363 branch: $GERRIT_BRANCH
364 submodule-recursive: "{submodule-recursive}"
365 submodule-timeout: "{submodule-timeout}"
366 submodule-disable: "{submodule-disable}"
367 choosing-strategy: default
370 - timed: "{obj:cron}"
372 server-name: "{gerrit-server-name}"
373 trigger-on: "{obj:gerrit_sonar_triggers}"
375 - project-compare-type: "ANT"
376 project-pattern: "{project}"
378 - branch-compare-type: "ANT"
379 branch-pattern: "**/{branch}"
380 file-paths: "{obj:gerrit_trigger_file_paths}"
388 name: "{project-name}-tox-sonar"
390 <<: *lf_python_common
394 - lf-infra-properties:
395 build-days-to-keep: "{build-days-to-keep}"
397 url: "{github-url}/{github-org}/{project}"
400 - lf-infra-github-scm:
401 url: "{git-clone-url}{github-org}/{project}"
402 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
404 submodule-recursive: "{submodule-recursive}"
405 submodule-timeout: "{submodule-timeout}"
406 submodule-disable: "{submodule-disable}"
407 choosing-strategy: default
408 jenkins-ssh-credential: "{jenkins-ssh-credential}"
411 - github-pull-request:
412 trigger-phrase: "^run-sonar$"
413 only-trigger-phrase: false
414 status-context: "Python Sonar"
417 white-list-target-branches:
419 included-regions: "{obj:github_included_regions}"
425 - lf_tox_common: &lf_tox_common
428 ######################
429 # Default parameters #
430 ######################
433 build-days-to-keep: 7
436 git-url: "$GIT_URL/$GERRIT_PROJECT"
437 github-url: "https://github.com"
439 pre-build-script: "# pre-build script goes here"
440 python-version: python3
442 submodule-recursive: true
443 submodule-timeout: 10
444 submodule-disable: false
448 gerrit_trigger_file_paths:
449 - compare-type: REG_EXP
452 # github_included_regions MUST match gerrit_trigger_file_paths
453 github_included_regions:
456 #####################
457 # Job Configuration #
458 #####################
460 project-type: freestyle
463 disabled: "{disable-job}"
466 - lf-infra-properties:
467 build-days-to-keep: "{build-days-to-keep}"
470 - lf-infra-parameters:
474 - lf-infra-tox-parameters:
476 tox-envs: "{tox-envs}"
480 build-timeout: "{build-timeout}"
481 jenkins-ssh-credential: "{jenkins-ssh-credential}"
485 - lf-infra-tox-install:
486 python-version: "{python-version}"
487 - shell: "{pre-build-script}"
489 parallel: "{parallel}"
495 # Python projects typically use tox to run testing.
496 name: "{project-name}-tox-verify-{stream}"
497 id: gerrit-tox-verify
500 ######################
501 # Default parameters #
502 ######################
504 gerrit-skip-vote: false
505 gerrit_verify_triggers:
506 - patchset-created-event:
508 exclude-trivial-rebase: false
509 exclude-no-code-change: false
510 - draft-published-event
511 - comment-added-contains-event:
512 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
514 #####################
515 # Job Configuration #
516 #####################
519 - lf-infra-gerrit-scm:
520 jenkins-ssh-credential: "{jenkins-ssh-credential}"
522 refspec: "$GERRIT_REFSPEC"
523 branch: "$GERRIT_BRANCH"
524 submodule-recursive: "{submodule-recursive}"
525 submodule-timeout: "{submodule-timeout}"
526 submodule-disable: "{submodule-disable}"
527 choosing-strategy: gerrit
531 server-name: "{gerrit-server-name}"
532 trigger-on: "{obj:gerrit_verify_triggers}"
534 - project-compare-type: ANT
535 project-pattern: "{project}"
537 - branch-compare-type: ANT
538 branch-pattern: "**/{branch}"
539 file-paths: "{obj:gerrit_trigger_file_paths}"
541 successful: "{gerrit-skip-vote}"
542 failed: "{gerrit-skip-vote}"
543 unstable: "{gerrit-skip-vote}"
544 notbuilt: "{gerrit-skip-vote}"
547 # Python projects typically use tox to run testing.
548 name: "{project-name}-tox-verify-{stream}"
549 id: github-tox-verify
553 - lf-infra-properties:
554 build-days-to-keep: "{build-days-to-keep}"
556 url: "{github-url}/{github-org}/{project}"
559 - lf-infra-github-scm:
560 url: "{git-clone-url}{github-org}/{project}"
561 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
563 submodule-recursive: "{submodule-recursive}"
564 submodule-timeout: "{submodule-timeout}"
565 submodule-disable: "{submodule-disable}"
566 choosing-strategy: default
567 jenkins-ssh-credential: "{jenkins-ssh-credential}"
570 - github-pull-request:
571 trigger-phrase: "^(recheck|reverify)$"
572 only-trigger-phrase: false
573 status-context: "Tox Verify"
576 white-list-target-branches:
578 included-regions: "{obj:github_included_regions}"
581 # Run tox after merge of gerrit change set
582 name: "{project-name}-tox-merge-{stream}"
586 ######################
587 # Default parameters #
588 ######################
590 gerrit_merge_triggers:
591 - change-merged-event
592 - comment-added-contains-event:
593 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
595 #####################
596 # Job Configuration #
597 #####################
600 - lf-infra-gerrit-scm:
601 jenkins-ssh-credential: "{jenkins-ssh-credential}"
603 refspec: "$GERRIT_REFSPEC"
604 branch: "$GERRIT_BRANCH"
605 submodule-recursive: "{submodule-recursive}"
606 submodule-timeout: "{submodule-timeout}"
607 submodule-disable: "{submodule-disable}"
608 # merge jobs always build from tip
609 choosing-strategy: default
613 server-name: "{gerrit-server-name}"
614 trigger-on: "{obj:gerrit_merge_triggers}"
616 - project-compare-type: ANT
617 project-pattern: "{project}"
619 - branch-compare-type: ANT
620 branch-pattern: "**/{branch}"
621 file-paths: "{obj:gerrit_trigger_file_paths}"
624 # Run tox after merge of github pull request
625 name: "{project-name}-tox-merge-{stream}"
630 - lf-infra-properties:
631 build-days-to-keep: "{build-days-to-keep}"
633 url: "{github-url}/{github-org}/{project}"
636 - lf-infra-github-scm:
637 url: "{git-clone-url}{github-org}/{project}"
639 branch: "refs/heads/{branch}"
640 submodule-recursive: "{submodule-recursive}"
641 submodule-timeout: "{submodule-timeout}"
642 submodule-disable: "{submodule-disable}"
643 choosing-strategy: default
644 jenkins-ssh-credential: "{jenkins-ssh-credential}"
647 - github-pull-request:
648 trigger-phrase: "^remerge$"
649 only-trigger-phrase: true
650 status-context: "Tox Merge"
655 white-list: "{obj:github_pr_whitelist}"
656 admin-list: "{obj:github_pr_admin_list}"
657 white-list-target-branches:
659 included-regions: "{obj:github_included_regions}"
665 - lf_pypi_common: &lf_pypi_common
668 ######################
669 # Default parameters #
670 ######################
675 build-days-to-keep: 7
679 git-url: "$GIT_URL/$GERRIT_PROJECT"
680 github-url: "https://github.com"
682 pre-build-script: "# pre-build script goes here"
683 python-version: python3
685 submodule-disable: false
686 submodule-recursive: true
687 submodule-timeout: 10
691 gerrit_trigger_file_paths:
692 - compare-type: REG_EXP
695 # github_included_regions MUST match gerrit_trigger_file_paths
696 github_included_regions:
699 #####################
700 # Job Configuration #
701 #####################
703 project-type: freestyle
705 disabled: "{disable-job}"
708 - lf-infra-properties:
709 build-days-to-keep: "{build-days-to-keep}"
712 - lf-infra-parameters:
716 - lf-infra-tox-parameters:
718 tox-envs: "{tox-envs}"
720 name: BUILD_BDIST_WHEEL
721 default: "{dist-binary}"
722 description: "Set to True (checked) to build a binary distribution"
726 description: "Set to True (checked) to skip uploading artifacts"
730 build-timeout: "{build-timeout}"
731 jenkins-ssh-credential: "{jenkins-ssh-credential}"
736 - lf_pypi_verify_builders: &lf_pypi_verify_builders
737 name: lf-pypi-verify-builders
741 - lf-infra-tox-install:
742 python-version: "{python-version}"
743 - shell: "{pre-build-script}"
745 parallel: "{parallel}"
746 - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
748 - lf_pypi_merge_builders: &lf_pypi_merge_builders
749 name: lf-pypi-merge-builders
753 - lf-infra-tox-install:
754 python-version: "{python-version}"
755 - shell: "{pre-build-script}"
757 parallel: "{parallel}"
758 - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
759 - config-file-provider:
762 target: "$HOME/.pypirc"
764 properties-content: "REPOSITORY={pypi-repo}"
765 - shell: !include-raw-escape: ../shell/pypi-upload.sh
768 name: "{project-name}-pypi-verify-{stream}"
769 id: gerrit-pypi-verify
771 <<: *lf_pypi_verify_builders
774 - lf-infra-gerrit-scm:
775 jenkins-ssh-credential: "{jenkins-ssh-credential}"
777 refspec: "$GERRIT_REFSPEC"
778 branch: "$GERRIT_BRANCH"
779 submodule-recursive: "{submodule-recursive}"
780 submodule-timeout: "{submodule-timeout}"
781 submodule-disable: "{submodule-disable}"
782 choosing-strategy: gerrit
786 server-name: "{gerrit-server-name}"
788 - patchset-created-event:
790 exclude-trivial-rebase: false
791 exclude-no-code-change: false
792 - draft-published-event
793 - comment-added-contains-event:
794 # yamllint disable-line rule:line-length
795 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
797 - project-compare-type: ANT
798 project-pattern: "{project}"
800 - branch-compare-type: ANT
801 branch-pattern: "**/{branch}"
802 file-paths: "{obj:gerrit_trigger_file_paths}"
805 name: "{project-name}-pypi-verify-{stream}"
806 id: github-pypi-verify
808 <<: *lf_pypi_verify_builders
812 url: "{github-url}/{github-org}/{project}"
815 - lf-infra-github-scm:
816 url: "{git-clone-url}{github-org}/{project}"
817 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
819 submodule-recursive: "{submodule-recursive}"
820 submodule-timeout: "{submodule-timeout}"
821 submodule-disable: "{submodule-disable}"
822 choosing-strategy: default
823 jenkins-ssh-credential: "{jenkins-ssh-credential}"
826 - github-pull-request:
827 trigger-phrase: "^(recheck|reverify)$"
828 only-trigger-phrase: false
829 status-context: "PyPI Verify"
832 white-list-target-branches:
834 included-regions: "{obj:github_included_regions}"
837 name: "{project-name}-pypi-merge-{stream}"
838 id: gerrit-pypi-merge
840 <<: *lf_pypi_merge_builders
846 - lf-infra-gerrit-scm:
847 jenkins-ssh-credential: "{jenkins-ssh-credential}"
849 refspec: "$GERRIT_REFSPEC"
850 branch: "$GERRIT_BRANCH"
851 submodule-recursive: "{submodule-recursive}"
852 submodule-timeout: "{submodule-timeout}"
853 submodule-disable: "{submodule-disable}"
854 # merge jobs always build from tip
855 choosing-strategy: default
858 - timed: "{obj:cron}"
860 server-name: "{gerrit-server-name}"
862 - change-merged-event
863 - comment-added-contains-event:
864 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
866 - project-compare-type: ANT
867 project-pattern: "{project}"
869 - branch-compare-type: ANT
870 branch-pattern: "**/{branch}"
871 file-paths: "{obj:gerrit_trigger_file_paths}"
874 name: "{project-name}-pypi-merge-{stream}"
875 id: github-pypi-merge
877 <<: *lf_pypi_merge_builders
884 url: "{github-url}/{github-org}/{project}"
887 - lf-infra-github-scm:
888 url: "{git-clone-url}{github-org}/{project}"
890 branch: "refs/heads/{branch}"
891 submodule-recursive: "{submodule-recursive}"
892 submodule-timeout: "{submodule-timeout}"
893 submodule-disable: "{submodule-disable}"
894 choosing-strategy: default
895 jenkins-ssh-credential: "{jenkins-ssh-credential}"
898 - timed: "{obj:cron}"
899 - github-pull-request:
900 trigger-phrase: "^remerge$"
901 only-trigger-phrase: false
902 status-context: "Merge"
907 white-list: "{obj:github_pr_whitelist}"
908 admin-list: "{obj:github_pr_admin_list}"
909 white-list-target-branches:
911 included-regions: "{obj:github_included_regions}"