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