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 choosing-strategy: gerrit
612 server-name: "{gerrit-server-name}"
613 trigger-on: "{obj:gerrit_merge_triggers}"
615 - project-compare-type: ANT
616 project-pattern: "{project}"
618 - branch-compare-type: ANT
619 branch-pattern: "**/{branch}"
620 file-paths: "{obj:gerrit_trigger_file_paths}"
623 # Run tox after merge of github pull request
624 name: "{project-name}-tox-merge-{stream}"
629 - lf-infra-properties:
630 build-days-to-keep: "{build-days-to-keep}"
632 url: "{github-url}/{github-org}/{project}"
635 - lf-infra-github-scm:
636 url: "{git-clone-url}{github-org}/{project}"
638 branch: "refs/heads/{branch}"
639 submodule-recursive: "{submodule-recursive}"
640 submodule-timeout: "{submodule-timeout}"
641 submodule-disable: "{submodule-disable}"
642 choosing-strategy: default
643 jenkins-ssh-credential: "{jenkins-ssh-credential}"
646 - github-pull-request:
647 trigger-phrase: "^remerge$"
648 only-trigger-phrase: true
649 status-context: "Tox Merge"
654 white-list: "{obj:github_pr_whitelist}"
655 admin-list: "{obj:github_pr_admin_list}"
656 white-list-target-branches:
658 included-regions: "{obj:github_included_regions}"
664 - lf_pypi_common: &lf_pypi_common
667 ######################
668 # Default parameters #
669 ######################
674 build-days-to-keep: 7
678 git-url: "$GIT_URL/$GERRIT_PROJECT"
679 github-url: "https://github.com"
681 pre-build-script: "# pre-build script goes here"
682 python-version: python3
684 submodule-disable: false
685 submodule-recursive: true
686 submodule-timeout: 10
690 gerrit_trigger_file_paths:
691 - compare-type: REG_EXP
694 # github_included_regions MUST match gerrit_trigger_file_paths
695 github_included_regions:
698 #####################
699 # Job Configuration #
700 #####################
702 project-type: freestyle
704 disabled: "{disable-job}"
707 - lf-infra-properties:
708 build-days-to-keep: "{build-days-to-keep}"
711 - lf-infra-parameters:
715 - lf-infra-tox-parameters:
717 tox-envs: "{tox-envs}"
719 name: BUILD_BDIST_WHEEL
720 default: "{dist-binary}"
721 description: "Set to True (checked) to build a binary distribution"
725 description: "Set to True (checked) to skip uploading artifacts"
729 build-timeout: "{build-timeout}"
730 jenkins-ssh-credential: "{jenkins-ssh-credential}"
735 - lf_pypi_verify_builders: &lf_pypi_verify_builders
736 name: lf-pypi-verify-builders
740 - lf-infra-tox-install:
741 python-version: "{python-version}"
742 - shell: "{pre-build-script}"
744 parallel: "{parallel}"
745 - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
747 - lf_pypi_merge_builders: &lf_pypi_merge_builders
748 name: lf-pypi-merge-builders
752 - lf-infra-tox-install:
753 python-version: "{python-version}"
754 - shell: "{pre-build-script}"
756 parallel: "{parallel}"
757 - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
758 - config-file-provider:
761 target: "$HOME/.pypirc"
763 properties-content: "REPOSITORY={pypi-repo}"
764 - shell: !include-raw-escape: ../shell/pypi-upload.sh
767 name: "{project-name}-pypi-verify-{stream}"
768 id: gerrit-pypi-verify
770 <<: *lf_pypi_verify_builders
773 - lf-infra-gerrit-scm:
774 jenkins-ssh-credential: "{jenkins-ssh-credential}"
776 refspec: "$GERRIT_REFSPEC"
777 branch: "$GERRIT_BRANCH"
778 submodule-recursive: "{submodule-recursive}"
779 submodule-timeout: "{submodule-timeout}"
780 submodule-disable: "{submodule-disable}"
781 choosing-strategy: gerrit
785 server-name: "{gerrit-server-name}"
787 - patchset-created-event:
789 exclude-trivial-rebase: false
790 exclude-no-code-change: false
791 - draft-published-event
792 - comment-added-contains-event:
793 # yamllint disable-line rule:line-length
794 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
796 - project-compare-type: ANT
797 project-pattern: "{project}"
799 - branch-compare-type: ANT
800 branch-pattern: "**/{branch}"
801 file-paths: "{obj:gerrit_trigger_file_paths}"
804 name: "{project-name}-pypi-verify-{stream}"
805 id: github-pypi-verify
807 <<: *lf_pypi_verify_builders
811 url: "{github-url}/{github-org}/{project}"
814 - lf-infra-github-scm:
815 url: "{git-clone-url}{github-org}/{project}"
816 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
818 submodule-recursive: "{submodule-recursive}"
819 submodule-timeout: "{submodule-timeout}"
820 submodule-disable: "{submodule-disable}"
821 choosing-strategy: default
822 jenkins-ssh-credential: "{jenkins-ssh-credential}"
825 - github-pull-request:
826 trigger-phrase: "^(recheck|reverify)$"
827 only-trigger-phrase: false
828 status-context: "PyPI Verify"
831 white-list-target-branches:
833 included-regions: "{obj:github_included_regions}"
836 name: "{project-name}-pypi-merge-{stream}"
837 id: gerrit-pypi-merge
839 <<: *lf_pypi_merge_builders
845 - lf-infra-gerrit-scm:
846 jenkins-ssh-credential: "{jenkins-ssh-credential}"
848 refspec: "$GERRIT_REFSPEC"
849 branch: "$GERRIT_BRANCH"
850 submodule-recursive: "{submodule-recursive}"
851 submodule-timeout: "{submodule-timeout}"
852 submodule-disable: "{submodule-disable}"
853 choosing-strategy: gerrit
856 - timed: "{obj:cron}"
858 server-name: "{gerrit-server-name}"
860 - change-merged-event
861 - comment-added-contains-event:
862 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
864 - project-compare-type: ANT
865 project-pattern: "{project}"
867 - branch-compare-type: ANT
868 branch-pattern: "**/{branch}"
869 file-paths: "{obj:gerrit_trigger_file_paths}"
872 name: "{project-name}-pypi-merge-{stream}"
873 id: github-pypi-merge
875 <<: *lf_pypi_merge_builders
882 url: "{github-url}/{github-org}/{project}"
885 - lf-infra-github-scm:
886 url: "{git-clone-url}{github-org}/{project}"
888 branch: "refs/heads/{branch}"
889 submodule-recursive: "{submodule-recursive}"
890 submodule-timeout: "{submodule-timeout}"
891 submodule-disable: "{submodule-disable}"
892 choosing-strategy: default
893 jenkins-ssh-credential: "{jenkins-ssh-credential}"
896 - timed: "{obj:cron}"
897 - github-pull-request:
898 trigger-phrase: "^remerge$"
899 only-trigger-phrase: false
900 status-context: "Merge"
905 white-list: "{obj:github_pr_whitelist}"
906 admin-list: "{obj:github_pr_admin_list}"
907 white-list-target-branches:
909 included-regions: "{obj:github_included_regions}"