Merge "Add step to verify stage repo is closed"
[releng/global-jjb.git] / jjb / lf-python-jobs.yaml
1 ---
2 ##########
3 # Macros #
4 ##########
5
6 - builder:
7     name: lf-infra-clm-python
8     builders:
9       - inject:
10           properties-content: "CLM_PROJECT_NAME={clm-project-name}"
11       - shell: !include-raw-escape: ../shell/nexus-iq-cli.sh
12
13 - builder:
14     name: lf-infra-pypi-tag-release
15     builders:
16       - config-file-provider:
17           files:
18             - file-id: sigul-config
19               variable: SIGUL_CONFIG
20             - file-id: sigul-password
21               variable: SIGUL_PASSWORD
22             - file-id: sigul-pki
23               variable: SIGUL_PKI
24             - file-id: signing-pubkey
25               variable: SIGNING_PUBKEY
26       - shell: !include-raw: ../shell/sigul-configuration.sh
27       - shell: !include-raw: ../shell/sigul-install.sh
28       - shell: !include-raw: ../shell/pypi-tag-release.sh
29
30 - builder:
31     name: lf-infra-pypi-upload
32     builders:
33       - config-file-provider:
34           files:
35             - file-id: pypirc
36               target: "$HOME/.pypirc"
37       - inject:
38           properties-content: "REPOSITORY={pypi-repo}"
39       - shell: !include-raw-escape: ../shell/pypi-upload.sh
40
41 - builder:
42     name: lf-infra-tox-install
43     builders:
44       - inject:
45           properties-content: "PYTHON={python-version}"
46       - shell: !include-raw-escape: ../shell/tox-install.sh
47
48 - builder:
49     name: lf-infra-tox-run
50     builders:
51       - inject:
52           properties-content: "PARALLEL={parallel}"
53       - shell: !include-raw-escape: ../shell/tox-run.sh
54
55 ####################
56 # COMMON FUNCTIONS #
57 ####################
58
59 - lf_python_common: &lf_python_common
60     name: lf-python-common
61
62     ######################
63     # Default parameters #
64     ######################
65
66     archive-artifacts: >
67       **/*.log
68
69     #####################
70     # Job Configuration #
71     #####################
72
73     project-type: freestyle
74     node: "{build-node}"
75
76     properties:
77       - lf-infra-properties:
78           build-days-to-keep: "{build-days-to-keep}"
79
80     parameters:
81       - lf-infra-parameters:
82           project: "{project}"
83           branch: "{branch}"
84           stream: "{stream}"
85
86     wrappers:
87       - lf-infra-wrappers:
88           build-timeout: "{build-timeout}"
89           jenkins-ssh-credential: "{jenkins-ssh-credential}"
90
91     publishers:
92       - lf-infra-publish
93
94 #################
95 # Python XC CLM #
96 #################
97
98 - lf_python_clm_xc: &lf_python_xc_clm
99     name: lf-python-xc-clm
100
101     ######################
102     # Default parameters #
103     ######################
104
105     branch: master
106     build-days-to-keep: 30 # 30 days for troubleshooting purposes
107     build-timeout: 60
108     disable-job: false
109     git-url: "$GIT_URL/$PROJECT"
110     github-url: "https://github.com"
111     java-version: openjdk8
112     nexus-iq-cli-version: 1.44.0-01
113     nexus-iq-namespace: "" # Recommend a trailing dash when set. Example: odl-
114     pre-build-script: "  # pre-build script goes here"
115     stream: master
116     submodule-recursive: true
117     submodule-timeout: 10
118     submodule-disable: false
119
120     gerrit_trigger_file_paths:
121       - compare-type: ANT
122         pattern: ".*"
123
124     # github_included_regions MUST match gerrit_trigger_file_paths
125     github_included_regions:
126       - ".*"
127
128     #####################
129     # Job Configuration #
130     #####################
131
132     disabled: "{disable-job}"
133
134     parameters:
135       - lf-infra-parameters:
136           project: "{project}"
137           branch: "{branch}"
138           stream: "{stream}"
139       - string:
140           name: NEXUS_IQ_CLI_VERSION
141           default: "{nexus-iq-cli-version}"
142           description: Nexus IQ CLI package to download and use.
143
144     wrappers:
145       - credentials-binding:
146           - username-password-separated:
147               credential-id: nexus-iq-xc-clm
148               username: CLM_USER
149               password: CLM_PASSWORD
150     builders:
151       - lf-update-java-alternatives:
152           java-version: "{java-version}"
153       - shell: "{pre-build-script}"
154       - lf-infra-clm-python:
155           clm-project-name: "{nexus-iq-namespace}{project-name}"
156
157 - job-template:
158     name: "{project-name}-python-clm-{stream}"
159     id: gerrit-python-xc-clm
160     <<: *lf_python_common
161     <<: *lf_python_xc_clm
162
163     ######################
164     # Default parameters #
165     ######################
166
167     gerrit_clm_triggers:
168       - comment-added-contains-event:
169           comment-contains-value: '^Patch Set\s+\d+:\s+run-clm\s*$'
170
171     #####################
172     # Job Configuration #
173     #####################
174
175     scm:
176       - lf-infra-gerrit-scm:
177           jenkins-ssh-credential: "{jenkins-ssh-credential}"
178           git-url: "{git-url}"
179           refspec: "$GERRIT_REFSPEC"
180           branch: "$GERRIT_BRANCH"
181           submodule-recursive: "{submodule-recursive}"
182           submodule-timeout: "{submodule-timeout}"
183           submodule-disable: "{submodule-disable}"
184           choosing-strategy: default
185
186     triggers:
187       # Build weekly on Saturdays
188       - timed: "H H * * 6"
189       - gerrit:
190           server-name: "{gerrit-server-name}"
191           trigger-on: "{obj:gerrit_clm_triggers}"
192           projects:
193             - project-compare-type: ANT
194               project-pattern: "{project}"
195               branches:
196                 - branch-compare-type: ANT
197                   branch-pattern: "**/{branch}"
198               file-paths: "{obj:gerrit_trigger_file_paths}"
199           skip-vote:
200             successful: true
201             failed: true
202             unstable: true
203             notbuilt: true
204
205 - job-template:
206     name: "{project-name}-python-clm-{stream}"
207     id: github-python-xc-clm
208     <<: *lf_python_common
209     <<: *lf_python_xc_clm
210
211     properties:
212       - lf-infra-properties:
213           build-days-to-keep: "{build-days-to-keep}"
214       - github:
215           url: "{github-url}/{github-org}/{project}"
216
217     scm:
218       - lf-infra-github-scm:
219           url: "{git-clone-url}{github-org}/{project}"
220           refspec: ""
221           branch: "refs/heads/{branch}"
222           submodule-recursive: "{submodule-recursive}"
223           submodule-timeout: "{submodule-timeout}"
224           submodule-disable: "{submodule-disable}"
225           choosing-strategy: default
226           jenkins-ssh-credential: "{jenkins-ssh-credential}"
227
228     triggers:
229       # Build weekly on Saturdays
230       - timed: "H H * * 6"
231       - github-pull-request:
232           trigger-phrase: "^run-clm$"
233           only-trigger-phrase: false
234           status-context: "CLM"
235           permit-all: true
236           github-hooks: true
237           white-list-target-branches:
238             - "{branch}"
239           included-regions: "{obj:github_included_regions}"
240
241 #########################
242 # Python Sonar with Tox #
243 #########################
244
245 - lf_tox_sonar: &lf_tox_sonar
246     name: lf-tox_sonar
247
248     ######################
249     # Default parameters #
250     ######################
251
252     branch: master # Sonar should always be run on master branch
253     build-days-to-keep: 7
254     build-timeout: 60
255     cron: "H H * * *" # run daily
256     disable-job: false
257     git-url: "$GIT_URL/$PROJECT"
258     github-url: "https://github.com"
259     java-version: openjdk8
260     mvn-global-settings: global-settings
261     mvn-goals: validate
262     mvn-settings: "{mvn-settings}"
263     mvn-version: mvn35
264     parallel: true
265     pre-build-script: "# pre-build script goes here"
266     python-version: python3
267     sonar-mvn-goal: "sonar:sonar"
268     sonarcloud: false
269     sonarcloud-project-key: ""
270     sonarcloud-project-organization: ""
271     sonarcloud-api-token: ""
272     stream: master
273     submodule-recursive: true
274     submodule-timeout: 10
275     submodule-disable: false
276     tox-dir: "."
277     tox-envs: ""
278
279     gerrit_trigger_file_paths:
280       - compare-type: REG_EXP
281         pattern: ".*"
282
283     # github_included_regions MUST match gerrit_trigger_file_paths
284     github_included_regions:
285       - ".*"
286
287     #####################
288     # Job Configuration #
289     #####################
290
291     disabled: "{disable-job}"
292
293     parameters:
294       - lf-infra-parameters:
295           project: "{project}"
296           branch: "{branch}"
297           stream: "{stream}"
298       - lf-infra-tox-parameters:
299           tox-dir: "{tox-dir}"
300           tox-envs: "{tox-envs}"
301       - string:
302           name: ARCHIVE_ARTIFACTS
303           default: "{archive-artifacts}"
304           description: Artifacts to archive to the logs server.
305       - string:
306           name: MVN
307           # Sets an env var for shell scripts to be able to call the dynamically
308           # installed maven without having to calculate the path themselves.
309           # yamllint disable-line rule:line-length
310           default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
311           description: "Maven selector to be used by shell scripts"
312       - string:
313           name: SONAR_MAVEN_GOAL
314           default: "{sonar-mvn-goal}"
315           description: |
316             Maven goals to pass to the Sonar call. Typically sonar:sonar
317             however to use a specific version of the sonar-maven-plugin we
318             can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
319
320     builders:
321       - lf-infra-pre-build
322       - lf-infra-tox-install:
323           python-version: "{python-version}"
324       - shell: "{pre-build-script}"
325       - lf-infra-tox-run:
326           parallel: "{parallel}"
327       - lf-provide-maven-settings:
328           global-settings-file: "{mvn-global-settings}"
329           settings-file: "{mvn-settings}"
330       # With SonarCloud
331       - conditional-step:
332           condition-kind: boolean-expression
333           condition-expression: "{sonarcloud}"
334           steps:
335             - shell: echo 'Using SonarCloud'
336             - lf-infra-maven-sonarcloud:
337                 java-version: "{java-version}"
338                 mvn-goals: "{mvn-goals}"
339                 mvn-settings: "{mvn-settings}"
340                 mvn-version: "{mvn-version}"
341                 sonarcloud-project-key: "{sonarcloud-project-key}"
342                 # yamllint disable-line rule:line-length
343                 sonarcloud-project-organization: "{sonarcloud-project-organization}"
344                 sonarcloud-api-token: "{sonarcloud-api-token}"
345       # With SonarQube
346       - conditional-step:
347           condition-kind: not
348           condition-operand:
349             condition-kind: boolean-expression
350             condition-expression: "{sonarcloud}"
351           steps:
352             - shell: echo 'Using SonarQube'
353             - lf-infra-maven-sonar:
354                 java-version: "{java-version}"
355                 mvn-goals: "{mvn-goals}"
356                 mvn-settings: "{mvn-settings}"
357                 mvn-version: "{mvn-version}"
358
359     publishers:
360       - lf-infra-publish
361
362 - job-template:
363     name: "{project-name}-tox-sonar"
364     id: gerrit-tox-sonar
365     <<: *lf_python_common
366     <<: *lf_tox_sonar
367
368     ######################
369     # Default parameters #
370     ######################
371
372     gerrit_sonar_triggers:
373       - comment-added-contains-event:
374           comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
375
376     #####################
377     # Job Configuration #
378     #####################
379
380     scm:
381       - lf-infra-gerrit-scm:
382           jenkins-ssh-credential: "{jenkins-ssh-credential}"
383           git-url: "{git-url}"
384           refspec: $GERRIT_REFSPEC
385           branch: $GERRIT_BRANCH
386           submodule-recursive: "{submodule-recursive}"
387           submodule-timeout: "{submodule-timeout}"
388           submodule-disable: "{submodule-disable}"
389           choosing-strategy: default
390
391     triggers:
392       - timed: "{obj:cron}"
393       - gerrit:
394           server-name: "{gerrit-server-name}"
395           trigger-on: "{obj:gerrit_sonar_triggers}"
396           projects:
397             - project-compare-type: "ANT"
398               project-pattern: "{project}"
399               branches:
400                 - branch-compare-type: "ANT"
401                   branch-pattern: "**/{branch}"
402               file-paths: "{obj:gerrit_trigger_file_paths}"
403           skip-vote:
404             successful: true
405             failed: true
406             unstable: true
407             notbuilt: true
408
409 - job-template:
410     name: "{project-name}-tox-sonar"
411     id: github-tox-sonar
412     <<: *lf_python_common
413     <<: *lf_tox_sonar
414
415     properties:
416       - lf-infra-properties:
417           build-days-to-keep: "{build-days-to-keep}"
418       - github:
419           url: "{github-url}/{github-org}/{project}"
420
421     scm:
422       - lf-infra-github-scm:
423           url: "{git-clone-url}{github-org}/{project}"
424           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
425           branch: "$sha1"
426           submodule-recursive: "{submodule-recursive}"
427           submodule-timeout: "{submodule-timeout}"
428           submodule-disable: "{submodule-disable}"
429           choosing-strategy: default
430           jenkins-ssh-credential: "{jenkins-ssh-credential}"
431
432     triggers:
433       - github-pull-request:
434           trigger-phrase: "^run-sonar$"
435           only-trigger-phrase: false
436           status-context: "Python Sonar"
437           permit-all: true
438           github-hooks: true
439           white-list-target-branches:
440             - "{branch}"
441           included-regions: "{obj:github_included_regions}"
442
443 ##############
444 # Tox Common #
445 ##############
446
447 - lf_tox_common: &lf_tox_common
448     name: lf-tox-common
449
450     ######################
451     # Default parameters #
452     ######################
453
454     branch: master
455     build-days-to-keep: 7
456     build-timeout: 15
457     disable-job: false
458     git-url: "$GIT_URL/$GERRIT_PROJECT"
459     github-url: "https://github.com"
460     parallel: false
461     pre-build-script: "# pre-build script goes here"
462     python-version: python3
463     stream: master
464     submodule-recursive: true
465     submodule-timeout: 10
466     submodule-disable: false
467     tox-dir: "."
468     tox-envs: ""
469
470     gerrit_trigger_file_paths:
471       - compare-type: REG_EXP
472         pattern: ".*"
473
474     # github_included_regions MUST match gerrit_trigger_file_paths
475     github_included_regions:
476       - ".*"
477
478     #####################
479     # Job Configuration #
480     #####################
481
482     project-type: freestyle
483     node: "{build-node}"
484     concurrent: true
485     disabled: "{disable-job}"
486
487     properties:
488       - lf-infra-properties:
489           build-days-to-keep: "{build-days-to-keep}"
490
491     parameters:
492       - lf-infra-parameters:
493           project: "{project}"
494           branch: "{branch}"
495           stream: "{stream}"
496       - lf-infra-tox-parameters:
497           tox-dir: "{tox-dir}"
498           tox-envs: "{tox-envs}"
499
500     wrappers:
501       - lf-infra-wrappers:
502           build-timeout: "{build-timeout}"
503           jenkins-ssh-credential: "{jenkins-ssh-credential}"
504
505     builders:
506       - lf-infra-pre-build
507       - lf-infra-tox-install:
508           python-version: "{python-version}"
509       - shell: "{pre-build-script}"
510       - lf-infra-tox-run:
511           parallel: "{parallel}"
512
513     publishers:
514       - lf-infra-publish
515
516 - job-template:
517     # Python projects typically use tox to run testing.
518     name: "{project-name}-tox-verify-{stream}"
519     id: gerrit-tox-verify
520     <<: *lf_tox_common
521
522     ######################
523     # Default parameters #
524     ######################
525
526     gerrit-skip-vote: false
527     gerrit_verify_triggers:
528       - patchset-created-event:
529           exclude-drafts: true
530           exclude-trivial-rebase: false
531           exclude-no-code-change: false
532       - draft-published-event
533       - comment-added-contains-event:
534           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
535
536     #####################
537     # Job Configuration #
538     #####################
539
540     scm:
541       - lf-infra-gerrit-scm:
542           jenkins-ssh-credential: "{jenkins-ssh-credential}"
543           git-url: "{git-url}"
544           refspec: "$GERRIT_REFSPEC"
545           branch: "$GERRIT_BRANCH"
546           submodule-recursive: "{submodule-recursive}"
547           submodule-timeout: "{submodule-timeout}"
548           submodule-disable: "{submodule-disable}"
549           choosing-strategy: gerrit
550
551     triggers:
552       - gerrit:
553           server-name: "{gerrit-server-name}"
554           trigger-on: "{obj:gerrit_verify_triggers}"
555           projects:
556             - project-compare-type: ANT
557               project-pattern: "{project}"
558               branches:
559                 - branch-compare-type: ANT
560                   branch-pattern: "**/{branch}"
561               file-paths: "{obj:gerrit_trigger_file_paths}"
562           skip-vote:
563             successful: "{gerrit-skip-vote}"
564             failed: "{gerrit-skip-vote}"
565             unstable: "{gerrit-skip-vote}"
566             notbuilt: "{gerrit-skip-vote}"
567
568 - job-template:
569     # Python projects typically use tox to run testing.
570     name: "{project-name}-tox-verify-{stream}"
571     id: github-tox-verify
572     <<: *lf_tox_common
573
574     properties:
575       - lf-infra-properties:
576           build-days-to-keep: "{build-days-to-keep}"
577       - github:
578           url: "{github-url}/{github-org}/{project}"
579
580     scm:
581       - lf-infra-github-scm:
582           url: "{git-clone-url}{github-org}/{project}"
583           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
584           branch: "$sha1"
585           submodule-recursive: "{submodule-recursive}"
586           submodule-timeout: "{submodule-timeout}"
587           submodule-disable: "{submodule-disable}"
588           choosing-strategy: default
589           jenkins-ssh-credential: "{jenkins-ssh-credential}"
590
591     triggers:
592       - github-pull-request:
593           trigger-phrase: "^(recheck|reverify)$"
594           only-trigger-phrase: false
595           status-context: "Tox Verify"
596           permit-all: true
597           github-hooks: true
598           white-list-target-branches:
599             - "{branch}"
600           included-regions: "{obj:github_included_regions}"
601
602 - job-template:
603     # Run tox after merge of gerrit change set
604     name: "{project-name}-tox-merge-{stream}"
605     id: gerrit-tox-merge
606     <<: *lf_tox_common
607
608     ######################
609     # Default parameters #
610     ######################
611
612     gerrit_merge_triggers:
613       - change-merged-event
614       - comment-added-contains-event:
615           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
616
617     #####################
618     # Job Configuration #
619     #####################
620
621     scm:
622       - lf-infra-gerrit-scm:
623           jenkins-ssh-credential: "{jenkins-ssh-credential}"
624           git-url: "{git-url}"
625           refspec: "$GERRIT_REFSPEC"
626           branch: "$GERRIT_BRANCH"
627           submodule-recursive: "{submodule-recursive}"
628           submodule-timeout: "{submodule-timeout}"
629           submodule-disable: "{submodule-disable}"
630           choosing-strategy: gerrit
631
632     triggers:
633       - gerrit:
634           server-name: "{gerrit-server-name}"
635           trigger-on: "{obj:gerrit_merge_triggers}"
636           projects:
637             - project-compare-type: ANT
638               project-pattern: "{project}"
639               branches:
640                 - branch-compare-type: ANT
641                   branch-pattern: "**/{branch}"
642               file-paths: "{obj:gerrit_trigger_file_paths}"
643
644 - job-template:
645     # Run tox after merge of github pull request
646     name: "{project-name}-tox-merge-{stream}"
647     id: github-tox-merge
648     <<: *lf_tox_common
649
650     properties:
651       - lf-infra-properties:
652           build-days-to-keep: "{build-days-to-keep}"
653       - github:
654           url: "{github-url}/{github-org}/{project}"
655
656     scm:
657       - lf-infra-github-scm:
658           url: "{git-clone-url}{github-org}/{project}"
659           refspec: ""
660           branch: "refs/heads/{branch}"
661           submodule-recursive: "{submodule-recursive}"
662           submodule-timeout: "{submodule-timeout}"
663           submodule-disable: "{submodule-disable}"
664           choosing-strategy: default
665           jenkins-ssh-credential: "{jenkins-ssh-credential}"
666
667     triggers:
668       - github-pull-request:
669           trigger-phrase: "^remerge$"
670           only-trigger-phrase: true
671           status-context: "Tox Merge"
672           permit-all: true
673           github-hooks: true
674           org-list:
675             - "{github-org}"
676           white-list: "{obj:github_pr_whitelist}"
677           admin-list: "{obj:github_pr_admin_list}"
678           white-list-target-branches:
679             - "{branch}"
680           included-regions: "{obj:github_included_regions}"
681
682 ########
683 # PyPI #
684 ########
685
686 - lf_pypi_common: &lf_pypi_common
687     name: lf-pypi-common
688
689     ######################
690     # Default parameters #
691     ######################
692
693     archive-artifacts: >
694       **/*.log
695     branch: master
696     build-days-to-keep: 7
697     build-timeout: 15
698     disable-job: false
699     dist-binary: true
700     git-url: "$GIT_URL/$GERRIT_PROJECT"
701     github-url: "https://github.com"
702     parallel: false
703     pre-build-script: "# pre-build script goes here"
704     python-version: python3
705     stream: master
706     submodule-disable: false
707     submodule-recursive: true
708     submodule-timeout: 10
709     tox-dir: "."
710     tox-envs: ""
711
712     gerrit_trigger_file_paths:
713       - compare-type: ANT
714         pattern: ".*"
715
716     # github_included_regions MUST match gerrit_trigger_file_paths
717     github_included_regions:
718       - ".*"
719
720     #####################
721     # Job Configuration #
722     #####################
723
724     project-type: freestyle
725     node: "{build-node}"
726     disabled: "{disable-job}"
727
728     properties:
729       - lf-infra-properties:
730           build-days-to-keep: "{build-days-to-keep}"
731
732     parameters:
733       - lf-infra-parameters:
734           project: "{project}"
735           branch: "{branch}"
736           stream: "{stream}"
737       - lf-infra-tox-parameters:
738           tox-dir: "{tox-dir}"
739           tox-envs: "{tox-envs}"
740       - bool:
741           name: BUILD_BDIST_WHEEL
742           default: "{dist-binary}"
743           description: "Set to True to build a wheel"
744       - bool:
745           name: DRY_RUN
746           default: false
747           description: |
748             If DRY_RUN is enabled artifacts are not published.
749
750     publishers:
751       - lf-infra-publish
752
753 - lf_pypi_common_wrappers: &lf_pypi_common_wrappers
754     name: lf-pypi-common-wrappers
755
756     wrappers:
757       - lf-infra-wrappers:
758           build-timeout: "{build-timeout}"
759           jenkins-ssh-credential: "{jenkins-ssh-credential}"
760
761 - lf_pypi_release_wrappers: &lf_pypi_release_wrappers
762     name: lf-pypi-release-wrappers
763
764     wrappers:
765       - lf-infra-wrappers:
766           build-timeout: "{build-timeout}"
767           jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
768
769 - lf_pypi_verify_builders: &lf_pypi_verify_builders
770     name: lf-pypi-verify-builders
771
772     builders:
773       - lf-infra-pre-build
774       - lf-infra-tox-install:
775           python-version: "{python-version}"
776       - shell: "{pre-build-script}"
777       - lf-infra-tox-run:
778           parallel: "{parallel}"
779       - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
780
781 - lf_pypi_merge_builders: &lf_pypi_merge_builders
782     name: lf-pypi-merge-builders
783
784     builders:
785       - lf-infra-pre-build
786       - lf-infra-tox-install:
787           python-version: "{python-version}"
788       - shell: "{pre-build-script}"
789       - lf-infra-tox-run:
790           parallel: "{parallel}"
791       - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
792       - lf-infra-pypi-upload:
793           pypi-repo: "{pypi-repo}"
794
795 - lf_pypi_release_verify_builders: &lf_pypi_release_verify_builders
796     name: lf-pypi-release-verify-builders
797
798     builders:
799       - lf-infra-pre-build
800       - lf-infra-tox-install:
801           python-version: "{python-version}"
802       - shell: "{pre-build-script}"
803       - lf-infra-tox-run:
804           parallel: "{parallel}"
805       - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
806       - lf-infra-pypi-tag-release
807
808 - lf_pypi_release_merge_builders: &lf_pypi_release_merge_builders
809     name: lf-pypi-release-merge-builders
810
811     builders:
812       - lf-infra-pre-build
813       - lf-infra-tox-install:
814           python-version: "{python-version}"
815       - shell: "{pre-build-script}"
816       - lf-infra-tox-run:
817           parallel: "{parallel}"
818       - shell: !include-raw-escape: ../shell/pypi-dist-build.sh
819       - lf-infra-pypi-tag-release
820       - lf-infra-pypi-upload:
821           pypi-repo: "{pypi-repo}"
822
823 - job-template:
824     name: "{project-name}-pypi-verify-{stream}"
825     id: gerrit-pypi-verify
826     <<: *lf_pypi_common
827     <<: *lf_pypi_common_wrappers
828     <<: *lf_pypi_verify_builders
829
830     scm:
831       - lf-infra-gerrit-scm:
832           jenkins-ssh-credential: "{jenkins-ssh-credential}"
833           git-url: "{git-url}"
834           refspec: "$GERRIT_REFSPEC"
835           branch: "$GERRIT_BRANCH"
836           submodule-recursive: "{submodule-recursive}"
837           submodule-timeout: "{submodule-timeout}"
838           submodule-disable: "{submodule-disable}"
839           choosing-strategy: gerrit
840
841     triggers:
842       - gerrit:
843           server-name: "{gerrit-server-name}"
844           trigger-on:
845             - patchset-created-event:
846                 exclude-drafts: true
847                 exclude-trivial-rebase: false
848                 exclude-no-code-change: false
849             - draft-published-event
850             - comment-added-contains-event:
851                 # yamllint disable-line rule:line-length
852                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
853           projects:
854             - project-compare-type: ANT
855               project-pattern: "{project}"
856               branches:
857                 - branch-compare-type: ANT
858                   branch-pattern: "**/{branch}"
859               file-paths: "{obj:gerrit_trigger_file_paths}"
860
861 - job-template:
862     name: "{project-name}-pypi-verify-{stream}"
863     id: github-pypi-verify
864     <<: *lf_pypi_common
865     <<: *lf_pypi_common_wrappers
866     <<: *lf_pypi_verify_builders
867
868     properties:
869       - github:
870           url: "{github-url}/{github-org}/{project}"
871
872     scm:
873       - lf-infra-github-scm:
874           url: "{git-clone-url}{github-org}/{project}"
875           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
876           branch: "$sha1"
877           submodule-recursive: "{submodule-recursive}"
878           submodule-timeout: "{submodule-timeout}"
879           submodule-disable: "{submodule-disable}"
880           choosing-strategy: default
881           jenkins-ssh-credential: "{jenkins-ssh-credential}"
882
883     triggers:
884       - github-pull-request:
885           trigger-phrase: "^(recheck|reverify)$"
886           only-trigger-phrase: false
887           status-context: "PyPI Verify"
888           permit-all: true
889           github-hooks: true
890           white-list-target-branches:
891             - "{branch}"
892           included-regions: "{obj:github_included_regions}"
893
894 - job-template:
895     name: "{project-name}-pypi-merge-{stream}"
896     id: gerrit-pypi-merge
897     <<: *lf_pypi_common
898     <<: *lf_pypi_common_wrappers
899     <<: *lf_pypi_merge_builders
900
901     cron: ""
902     pypi-repo: pypi-test
903
904     scm:
905       - lf-infra-gerrit-scm:
906           jenkins-ssh-credential: "{jenkins-ssh-credential}"
907           git-url: "{git-url}"
908           refspec: "$GERRIT_REFSPEC"
909           branch: "$GERRIT_BRANCH"
910           submodule-recursive: "{submodule-recursive}"
911           submodule-timeout: "{submodule-timeout}"
912           submodule-disable: "{submodule-disable}"
913           choosing-strategy: gerrit
914
915     triggers:
916       - timed: "{obj:cron}"
917       - gerrit:
918           server-name: "{gerrit-server-name}"
919           trigger-on:
920             - change-merged-event
921             - comment-added-contains-event:
922                 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
923           projects:
924             - project-compare-type: ANT
925               project-pattern: "{project}"
926               branches:
927                 - branch-compare-type: ANT
928                   branch-pattern: "**/{branch}"
929               file-paths: "{obj:gerrit_trigger_file_paths}"
930
931 - job-template:
932     name: "{project-name}-pypi-merge-{stream}"
933     id: github-pypi-merge
934     <<: *lf_pypi_common
935     <<: *lf_pypi_common_wrappers
936     <<: *lf_pypi_merge_builders
937
938     cron: ""
939     pypi-repo: pypi-test
940
941     properties:
942       - github:
943           url: "{github-url}/{github-org}/{project}"
944
945     scm:
946       - lf-infra-github-scm:
947           url: "{git-clone-url}{github-org}/{project}"
948           refspec: ""
949           branch: "refs/heads/{branch}"
950           submodule-recursive: "{submodule-recursive}"
951           submodule-timeout: "{submodule-timeout}"
952           submodule-disable: "{submodule-disable}"
953           choosing-strategy: default
954           jenkins-ssh-credential: "{jenkins-ssh-credential}"
955
956     triggers:
957       - timed: "{obj:cron}"
958       - github-pull-request:
959           trigger-phrase: "^remerge$"
960           only-trigger-phrase: false
961           status-context: "Merge"
962           permit-all: true
963           github-hooks: true
964           org-list:
965             - "{github-org}"
966           white-list: "{obj:github_pr_whitelist}"
967           admin-list: "{obj:github_pr_admin_list}"
968           white-list-target-branches:
969             - "{branch}"
970           included-regions: "{obj:github_included_regions}"
971
972 - lf_pypi_release_common: &lf_pypi_release_common
973     name: lf-pypi-release-common
974
975     dist-binary: true
976     pypi-repo: pypi
977     use-release-file: true
978
979     # define once and use twice; jobs MUST NOT override
980     gerrit_release_trigger_file_paths:
981       - compare-type: REG_EXP
982         pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
983
984     # yamllint disable-line rule:line-length
985     # github_release_included_regions MUST match gerrit_release_trigger_file_paths
986     github_release_included_regions:
987       - 'releases\/.*\.yaml'
988       - '.releases\/.*\.yaml'
989
990     parameters:
991       - lf-infra-parameters:
992           project: "{project}"
993           branch: "{branch}"
994           stream: "{stream}"
995       - lf-infra-tox-parameters:
996           tox-dir: "{tox-dir}"
997           tox-envs: "{tox-envs}"
998       - bool:
999           name: BUILD_BDIST_WHEEL
1000           default: "{dist-binary}"
1001           description: "Set to True to build a wheel"
1002       - string:
1003           name: VERSION
1004           default: ""
1005           description: "This is the version, example: 1.0.0"
1006       - bool:
1007           name: USE_RELEASE_FILE
1008           default: "{use-release-file}"
1009           description: "Set to False for job built with parameters"
1010       - bool:
1011           name: DRY_RUN
1012           default: false
1013           description: |
1014             If DRY_RUN is enabled artifacts are not published.
1015
1016 - job-template:
1017     name: "{project-name}-pypi-release-verify-{stream}"
1018     id: gerrit-pypi-release-verify
1019     <<: *lf_pypi_common
1020     <<: *lf_pypi_common_wrappers
1021     <<: *lf_pypi_release_common
1022     <<: *lf_pypi_release_verify_builders
1023
1024     scm:
1025       - lf-infra-gerrit-scm:
1026           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1027           git-url: "{git-url}"
1028           refspec: "$GERRIT_REFSPEC"
1029           branch: "$GERRIT_BRANCH"
1030           submodule-recursive: "{submodule-recursive}"
1031           submodule-timeout: "{submodule-timeout}"
1032           submodule-disable: "{submodule-disable}"
1033           choosing-strategy: gerrit
1034
1035     triggers:
1036       - gerrit:
1037           server-name: "{gerrit-server-name}"
1038           trigger-on:
1039             - patchset-created-event:
1040                 exclude-drafts: true
1041                 exclude-trivial-rebase: false
1042                 exclude-no-code-change: false
1043             - draft-published-event
1044             - comment-added-contains-event:
1045                 # yamllint disable-line rule:line-length
1046                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1047           projects:
1048             - project-compare-type: "ANT"
1049               project-pattern: "{project}"
1050               branches:
1051                 - branch-compare-type: ANT
1052                   branch-pattern: "**/{branch}"
1053               file-paths: "{obj:gerrit_release_trigger_file_paths}"
1054
1055 - job-template:
1056     name: "{project-name}-pypi-release-verify-{stream}"
1057     id: github-pypi-release-verify
1058     <<: *lf_pypi_common
1059     <<: *lf_pypi_common_wrappers
1060     <<: *lf_pypi_release_common
1061     <<: *lf_pypi_release_verify_builders
1062
1063     properties:
1064       - github:
1065           url: "{github-url}/{github-org}/{project}"
1066
1067     scm:
1068       - lf-infra-github-scm:
1069           url: "{git-clone-url}{github-org}/{project}"
1070           refspec: ""
1071           branch: "refs/heads/{branch}"
1072           submodule-recursive: "{submodule-recursive}"
1073           submodule-timeout: "{submodule-timeout}"
1074           submodule-disable: "{submodule-disable}"
1075           choosing-strategy: default
1076           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1077
1078     triggers:
1079       - github-pull-request:
1080           trigger-phrase: "^(recheck|reverify)$"
1081           only-trigger-phrase: false
1082           status-context: "PyPI Release Verify"
1083           permit-all: true
1084           github-hooks: true
1085           white-list-target-branches:
1086             - "{branch}"
1087           included-regions: "{obj:github_release_included_regions}"
1088
1089 - job-template:
1090     name: "{project-name}-pypi-release-merge-{stream}"
1091     id: gerrit-pypi-release-merge
1092     <<: *lf_pypi_common
1093     <<: *lf_pypi_release_wrappers
1094     <<: *lf_pypi_release_common
1095     <<: *lf_pypi_release_merge_builders
1096
1097     scm:
1098       - lf-infra-gerrit-scm:
1099           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1100           git-url: "{git-url}"
1101           refspec: "$GERRIT_REFSPEC"
1102           branch: "$GERRIT_BRANCH"
1103           submodule-recursive: "{submodule-recursive}"
1104           submodule-timeout: "{submodule-timeout}"
1105           submodule-disable: "{submodule-disable}"
1106           choosing-strategy: gerrit
1107
1108     triggers:
1109       - gerrit:
1110           server-name: "{gerrit-server-name}"
1111           trigger-on:
1112             - change-merged-event
1113             - comment-added-contains-event:
1114                 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
1115           projects:
1116             - project-compare-type: "ANT"
1117               project-pattern: "{project}"
1118               branches:
1119                 - branch-compare-type: ANT
1120                   branch-pattern: "**/{branch}"
1121               file-paths: "{obj:gerrit_release_trigger_file_paths}"
1122
1123 - job-template:
1124     name: "{project-name}-pypi-release-merge-{stream}"
1125     id: github-pypi-release-merge
1126     <<: *lf_pypi_common
1127     <<: *lf_pypi_release_wrappers
1128     <<: *lf_pypi_release_common
1129     <<: *lf_pypi_release_merge_builders
1130
1131     properties:
1132       - github:
1133           url: "{github-url}/{github-org}/{project}"
1134
1135     scm:
1136       - lf-infra-github-scm:
1137           url: "{git-clone-url}{github-org}/{project}"
1138           refspec: ""
1139           branch: "refs/heads/{branch}"
1140           submodule-recursive: "{submodule-recursive}"
1141           submodule-timeout: "{submodule-timeout}"
1142           submodule-disable: "{submodule-disable}"
1143           choosing-strategy: default
1144           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1145
1146     triggers:
1147       - github-pull-request:
1148           trigger-phrase: "^(remerge)$"
1149           only-trigger-phrase: false
1150           status-context: "PyPI Release Merge"
1151           permit-all: true
1152           github-hooks: true
1153           white-list-target-branches:
1154             - "{branch}"
1155           included-regions: "{obj:github_release_included_regions}"