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
234 mvn-settings: "{mvn-settings}"
237 pre-build-script: "# pre-build script goes here"
238 python-version: python3
239 sonar-mvn-goal: "sonar:sonar"
241 sonarcloud-project-key: ""
242 sonarcloud-project-organization: ""
243 sonarcloud-api-token: ""
245 submodule-recursive: true
246 submodule-timeout: 10
247 submodule-disable: false
251 gerrit_trigger_file_paths:
252 - compare-type: REG_EXP
255 # github_included_regions MUST match gerrit_trigger_file_paths
256 github_included_regions:
259 #####################
260 # Job Configuration #
261 #####################
263 disabled: "{disable-job}"
266 - lf-infra-parameters:
270 - lf-infra-tox-parameters:
272 tox-envs: "{tox-envs}"
274 name: ARCHIVE_ARTIFACTS
275 default: "{archive-artifacts}"
276 description: Artifacts to archive to the logs server.
279 # Sets an env var for shell scripts to be able to call the dynamically
280 # installed maven without having to calculate the path themselves.
281 # yamllint disable-line rule:line-length
282 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
283 description: "Maven selector to be used by shell scripts"
285 name: SONAR_MAVEN_GOAL
286 default: "{sonar-mvn-goal}"
288 Maven goals to pass to the Sonar call. Typically sonar:sonar
289 however to use a specific version of the sonar-maven-plugin we
290 can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
294 - lf-infra-tox-install:
295 python-version: "{python-version}"
296 - shell: "{pre-build-script}"
298 parallel: "{parallel}"
299 - lf-provide-maven-settings:
300 global-settings-file: "{mvn-global-settings}"
301 settings-file: "{mvn-settings}"
304 condition-kind: boolean-expression
305 condition-expression: "{sonarcloud}"
307 - shell: echo 'Using SonarCloud'
308 - lf-infra-maven-sonarcloud:
309 java-version: "{java-version}"
310 mvn-goals: "{mvn-goals}"
311 mvn-settings: "{mvn-settings}"
312 mvn-version: "{mvn-version}"
313 sonarcloud-project-key: "{sonarcloud-project-key}"
314 # yamllint disable-line rule:line-length
315 sonarcloud-project-organization: "{sonarcloud-project-organization}"
316 sonarcloud-api-token: "{sonarcloud-api-token}"
321 condition-kind: boolean-expression
322 condition-expression: "{sonarcloud}"
324 - shell: echo 'Using SonarQube'
325 - lf-infra-maven-sonar:
326 java-version: "{java-version}"
327 mvn-goals: "{mvn-goals}"
328 mvn-settings: "{mvn-settings}"
329 mvn-version: "{mvn-version}"
335 name: "{project-name}-tox-sonar"
337 <<: *lf_python_common
340 ######################
341 # Default parameters #
342 ######################
344 gerrit_sonar_triggers:
345 - comment-added-contains-event:
346 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
348 #####################
349 # Job Configuration #
350 #####################
353 - lf-infra-gerrit-scm:
354 jenkins-ssh-credential: "{jenkins-ssh-credential}"
356 refspec: $GERRIT_REFSPEC
357 branch: $GERRIT_BRANCH
358 submodule-recursive: "{submodule-recursive}"
359 submodule-timeout: "{submodule-timeout}"
360 submodule-disable: "{submodule-disable}"
361 choosing-strategy: default
364 - timed: "{obj:cron}"
366 server-name: "{gerrit-server-name}"
367 trigger-on: "{obj:gerrit_sonar_triggers}"
369 - project-compare-type: "ANT"
370 project-pattern: "{project}"
372 - branch-compare-type: "ANT"
373 branch-pattern: "**/{branch}"
374 file-paths: "{obj:gerrit_trigger_file_paths}"
382 name: "{project-name}-tox-sonar"
384 <<: *lf_python_common
388 - lf-infra-properties:
389 build-days-to-keep: "{build-days-to-keep}"
391 url: "{github-url}/{github-org}/{project}"
394 - lf-infra-github-scm:
395 url: "{git-clone-url}{github-org}/{project}"
396 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
398 submodule-recursive: "{submodule-recursive}"
399 submodule-timeout: "{submodule-timeout}"
400 submodule-disable: "{submodule-disable}"
401 choosing-strategy: default
402 jenkins-ssh-credential: "{jenkins-ssh-credential}"
405 - github-pull-request:
406 trigger-phrase: "^run-sonar$"
407 only-trigger-phrase: false
408 status-context: "Python Sonar"
411 white-list-target-branches:
413 included-regions: "{obj:github_included_regions}"
419 - lf_tox_common: &lf_tox_common
422 ######################
423 # Default parameters #
424 ######################
427 build-days-to-keep: 7
430 git-url: "$GIT_URL/$GERRIT_PROJECT"
431 github-url: "https://github.com"
433 pre-build-script: "# pre-build script goes here"
434 python-version: python3
436 submodule-recursive: true
437 submodule-timeout: 10
438 submodule-disable: false
442 gerrit_trigger_file_paths:
443 - compare-type: REG_EXP
446 # github_included_regions MUST match gerrit_trigger_file_paths
447 github_included_regions:
450 #####################
451 # Job Configuration #
452 #####################
454 project-type: freestyle
457 disabled: "{disable-job}"
460 - lf-infra-properties:
461 build-days-to-keep: "{build-days-to-keep}"
464 - lf-infra-parameters:
468 - lf-infra-tox-parameters:
470 tox-envs: "{tox-envs}"
474 build-timeout: "{build-timeout}"
475 jenkins-ssh-credential: "{jenkins-ssh-credential}"
479 - lf-infra-tox-install:
480 python-version: "{python-version}"
481 - shell: "{pre-build-script}"
483 parallel: "{parallel}"
489 # Python projects typically use tox to run testing.
490 name: "{project-name}-tox-verify-{stream}"
491 id: gerrit-tox-verify
494 ######################
495 # Default parameters #
496 ######################
498 gerrit-skip-vote: false
499 gerrit_verify_triggers:
500 - patchset-created-event:
502 exclude-trivial-rebase: false
503 exclude-no-code-change: false
504 - draft-published-event
505 - comment-added-contains-event:
506 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
508 #####################
509 # Job Configuration #
510 #####################
513 - lf-infra-gerrit-scm:
514 jenkins-ssh-credential: "{jenkins-ssh-credential}"
516 refspec: "$GERRIT_REFSPEC"
517 branch: "$GERRIT_BRANCH"
518 submodule-recursive: "{submodule-recursive}"
519 submodule-timeout: "{submodule-timeout}"
520 submodule-disable: "{submodule-disable}"
521 choosing-strategy: gerrit
525 server-name: "{gerrit-server-name}"
526 trigger-on: "{obj:gerrit_verify_triggers}"
528 - project-compare-type: ANT
529 project-pattern: "{project}"
531 - branch-compare-type: ANT
532 branch-pattern: "**/{branch}"
533 file-paths: "{obj:gerrit_trigger_file_paths}"
535 successful: "{gerrit-skip-vote}"
536 failed: "{gerrit-skip-vote}"
537 unstable: "{gerrit-skip-vote}"
538 notbuilt: "{gerrit-skip-vote}"
541 # Python projects typically use tox to run testing.
542 name: "{project-name}-tox-verify-{stream}"
543 id: github-tox-verify
547 - lf-infra-properties:
548 build-days-to-keep: "{build-days-to-keep}"
550 url: "{github-url}/{github-org}/{project}"
553 - lf-infra-github-scm:
554 url: "{git-clone-url}{github-org}/{project}"
555 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
557 submodule-recursive: "{submodule-recursive}"
558 submodule-timeout: "{submodule-timeout}"
559 submodule-disable: "{submodule-disable}"
560 choosing-strategy: default
561 jenkins-ssh-credential: "{jenkins-ssh-credential}"
564 - github-pull-request:
565 trigger-phrase: "^(recheck|reverify)$"
566 only-trigger-phrase: false
567 status-context: "Tox Verify"
570 white-list-target-branches:
572 included-regions: "{obj:github_included_regions}"
575 # Run tox after merge of gerrit change set
576 name: "{project-name}-tox-merge-{stream}"
580 ######################
581 # Default parameters #
582 ######################
584 gerrit_merge_triggers:
585 - change-merged-event
586 - comment-added-contains-event:
587 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
589 #####################
590 # Job Configuration #
591 #####################
594 - lf-infra-gerrit-scm:
595 jenkins-ssh-credential: "{jenkins-ssh-credential}"
597 refspec: "$GERRIT_REFSPEC"
598 branch: "$GERRIT_BRANCH"
599 submodule-recursive: "{submodule-recursive}"
600 submodule-timeout: "{submodule-timeout}"
601 submodule-disable: "{submodule-disable}"
602 choosing-strategy: gerrit
606 server-name: "{gerrit-server-name}"
607 trigger-on: "{obj:gerrit_merge_triggers}"
609 - project-compare-type: ANT
610 project-pattern: "{project}"
612 - branch-compare-type: ANT
613 branch-pattern: "**/{branch}"
614 file-paths: "{obj:gerrit_trigger_file_paths}"
617 # Run tox after merge of github pull request
618 name: "{project-name}-tox-merge-{stream}"
623 - lf-infra-properties:
624 build-days-to-keep: "{build-days-to-keep}"
626 url: "{github-url}/{github-org}/{project}"
629 - lf-infra-github-scm:
630 url: "{git-clone-url}{github-org}/{project}"
632 branch: "refs/heads/{branch}"
633 submodule-recursive: "{submodule-recursive}"
634 submodule-timeout: "{submodule-timeout}"
635 submodule-disable: "{submodule-disable}"
636 choosing-strategy: default
637 jenkins-ssh-credential: "{jenkins-ssh-credential}"
640 - github-pull-request:
641 trigger-phrase: "^remerge$"
642 only-trigger-phrase: true
643 status-context: "Tox Merge"
648 white-list: "{obj:github_pr_whitelist}"
649 admin-list: "{obj:github_pr_admin_list}"
650 white-list-target-branches:
652 included-regions: "{obj:github_included_regions}"
658 - lf_pypi_common: &lf_pypi_common
661 ######################
662 # Default parameters #
663 ######################
668 build-days-to-keep: 7
672 git-url: "$GIT_URL/$GERRIT_PROJECT"
673 github-url: "https://github.com"
675 pre-build-script: "# pre-build script goes here"
676 python-version: python3
678 submodule-disable: false
679 submodule-recursive: true
680 submodule-timeout: 10
684 gerrit_trigger_file_paths:
685 - compare-type: REG_EXP
688 # github_included_regions MUST match gerrit_trigger_file_paths
689 github_included_regions:
692 #####################
693 # Job Configuration #
694 #####################
696 project-type: freestyle
698 disabled: "{disable-job}"
701 - lf-infra-properties:
702 build-days-to-keep: "{build-days-to-keep}"
705 - lf-infra-parameters:
709 - lf-infra-tox-parameters:
711 tox-envs: "{tox-envs}"
713 name: BUILD_BDIST_WHEEL
714 default: "{dist-binary}"
715 description: "Set to True (checked) to build a binary distribution"
719 description: "Set to True (checked) to skip uploading artifacts"
723 build-timeout: "{build-timeout}"
724 jenkins-ssh-credential: "{jenkins-ssh-credential}"
729 - lf_pypi_verify_builders: &lf_pypi_verify_builders
730 name: lf-pypi-verify-builders
734 - lf-infra-tox-install:
735 python-version: "{python-version}"
736 - shell: "{pre-build-script}"
738 parallel: "{parallel}"
739 - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
741 - lf_pypi_merge_builders: &lf_pypi_merge_builders
742 name: lf-pypi-merge-builders
746 - lf-infra-tox-install:
747 python-version: "{python-version}"
748 - shell: "{pre-build-script}"
750 parallel: "{parallel}"
751 - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
752 - config-file-provider:
755 target: "$HOME/.pypirc"
757 properties-content: "REPOSITORY={pypi-repo}"
758 - shell: !include-raw-escape: ../shell/pypi-upload.sh
761 name: "{project-name}-pypi-verify-{stream}"
762 id: gerrit-pypi-verify
764 <<: *lf_pypi_verify_builders
767 - lf-infra-gerrit-scm:
768 jenkins-ssh-credential: "{jenkins-ssh-credential}"
770 refspec: "$GERRIT_REFSPEC"
771 branch: "$GERRIT_BRANCH"
772 submodule-recursive: "{submodule-recursive}"
773 submodule-timeout: "{submodule-timeout}"
774 submodule-disable: "{submodule-disable}"
775 choosing-strategy: gerrit
779 server-name: "{gerrit-server-name}"
781 - patchset-created-event:
783 exclude-trivial-rebase: false
784 exclude-no-code-change: false
785 - draft-published-event
786 - comment-added-contains-event:
787 # yamllint disable-line rule:line-length
788 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
790 - project-compare-type: ANT
791 project-pattern: "{project}"
793 - branch-compare-type: ANT
794 branch-pattern: "**/{branch}"
795 file-paths: "{obj:gerrit_trigger_file_paths}"
798 name: "{project-name}-pypi-verify-{stream}"
799 id: github-pypi-verify
801 <<: *lf_pypi_verify_builders
805 url: "{github-url}/{github-org}/{project}"
808 - lf-infra-github-scm:
809 url: "{git-clone-url}{github-org}/{project}"
810 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
812 submodule-recursive: "{submodule-recursive}"
813 submodule-timeout: "{submodule-timeout}"
814 submodule-disable: "{submodule-disable}"
815 choosing-strategy: default
816 jenkins-ssh-credential: "{jenkins-ssh-credential}"
819 - github-pull-request:
820 trigger-phrase: "^(recheck|reverify)$"
821 only-trigger-phrase: false
822 status-context: "PyPI Verify"
825 white-list-target-branches:
827 included-regions: "{obj:github_included_regions}"
830 name: "{project-name}-pypi-merge-{stream}"
831 id: gerrit-pypi-merge
833 <<: *lf_pypi_merge_builders
839 - lf-infra-gerrit-scm:
840 jenkins-ssh-credential: "{jenkins-ssh-credential}"
842 refspec: "$GERRIT_REFSPEC"
843 branch: "$GERRIT_BRANCH"
844 submodule-recursive: "{submodule-recursive}"
845 submodule-timeout: "{submodule-timeout}"
846 submodule-disable: "{submodule-disable}"
847 choosing-strategy: gerrit
850 - timed: "{obj:cron}"
852 server-name: "{gerrit-server-name}"
854 - change-merged-event
855 - comment-added-contains-event:
856 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
858 - project-compare-type: ANT
859 project-pattern: "{project}"
861 - branch-compare-type: ANT
862 branch-pattern: "**/{branch}"
863 file-paths: "{obj:gerrit_trigger_file_paths}"
866 name: "{project-name}-pypi-merge-{stream}"
867 id: github-pypi-merge
869 <<: *lf_pypi_merge_builders
876 url: "{github-url}/{github-org}/{project}"
879 - lf-infra-github-scm:
880 url: "{git-clone-url}{github-org}/{project}"
882 branch: "refs/heads/{branch}"
883 submodule-recursive: "{submodule-recursive}"
884 submodule-timeout: "{submodule-timeout}"
885 submodule-disable: "{submodule-disable}"
886 choosing-strategy: default
887 jenkins-ssh-credential: "{jenkins-ssh-credential}"
890 - timed: "{obj:cron}"
891 - github-pull-request:
892 trigger-phrase: "^remerge$"
893 only-trigger-phrase: false
894 status-context: "Merge"
899 white-list: "{obj:github_pr_whitelist}"
900 admin-list: "{obj:github_pr_admin_list}"
901 white-list-target-branches:
903 included-regions: "{obj:github_included_regions}"