1 # SPDX-License-Identifier: Apache-2.0
2 ##############################################################################
3 # Copyright (c) 2019 The Linux Foundation and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
14 - lf_release_common: &lf_release_common
15 name: lf-release-common
21 project-type: freestyle
25 - lf-infra-properties:
35 - lf_release_verify: &lf_release_verify
36 name: lf-release-verify
38 ######################
39 # Default parameters #
40 ######################
45 git-url: "$GIT_URL/$PROJECT"
46 gerrit-skip-vote: false
47 use-release-file: true
49 gerrit_verify_triggers:
50 - patchset-created-event:
52 exclude-trivial-rebase: false
53 exclude-no-code-change: false
54 - draft-published-event
55 - comment-added-contains-event:
56 # yamllint disable-line rule:line-length
57 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
59 github_included_regions:
60 - '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
66 disabled: "{disable-job}"
69 - lf-infra-parameters:
71 branch: "$GERRIT_BRANCH"
72 stream: "$GERRIT_BRANCH"
73 - lf-build-with-parameters-maven-release:
74 use-release-file: "{use-release-file}"
79 condition-kind: regex-match
80 regex: "^.*-docker-.*"
83 - lf-provide-maven-settings:
84 global-settings-file: "global-settings"
85 settings-file: "{mvn-settings}"
86 - shell: !include-raw-escape: ../shell/docker-login.sh
87 - lf-provide-maven-settings-cleanup
88 - config-file-provider:
90 - file-id: sigul-config
91 variable: SIGUL_CONFIG
92 - file-id: sigul-password
93 variable: SIGUL_PASSWORD
96 - file-id: signing-pubkey
97 variable: SIGNING_PUBKEY
98 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
99 - shell: !include-raw-escape: ../shell/sigul-install.sh
103 name: "{project-name}-release-verify"
104 id: gerrit-release-verify
105 <<: *lf_release_common
106 # yamllint disable-line rule:key-duplicates
107 <<: *lf_release_verify
111 build-timeout: "{build-timeout}"
112 jenkins-ssh-credential: "{jenkins-ssh-credential}"
115 - lf-infra-gerrit-scm:
117 refspec: "$GERRIT_REFSPEC"
118 branch: "$GERRIT_BRANCH"
119 submodule-disable: true
120 submodule-recursive: false
121 submodule-timeout: 10
122 choosing-strategy: gerrit
123 jenkins-ssh-credential: "{jenkins-ssh-credential}"
127 server-name: "{gerrit-server-name}"
128 trigger-on: "{obj:gerrit_verify_triggers}"
130 - project-compare-type: "ANT"
131 project-pattern: "{project}"
133 - branch-compare-type: "ANT"
136 - compare-type: REG_EXP
137 pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
139 successful: "{gerrit-skip-vote}"
140 failed: "{gerrit-skip-vote}"
141 unstable: "{gerrit-skip-vote}"
142 notbuilt: "{gerrit-skip-vote}"
145 name: "{project-name}-release-verify"
146 id: github-release-verify
147 <<: *lf_release_common
148 # yamllint disable-line rule:key-duplicates
149 <<: *lf_release_verify
152 - lf-infra-properties:
153 build-days-to-keep: "{build-days-to-keep}"
155 url: "{github-url}/{github-org}/{project}"
159 build-timeout: "{build-timeout}"
160 jenkins-ssh-credential: "{jenkins-ssh-credential}"
163 - lf-infra-github-scm:
164 url: "{git-clone-url}{github-org}/{project}"
165 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
167 submodule-recursive: "{submodule-recursive}"
168 submodule-timeout: "{submodule-timeout}"
169 submodule-disable: "{submodule-disable}"
170 choosing-strategy: default
171 jenkins-ssh-credential: "{jenkins-ssh-credential}"
174 - github-pull-request:
175 trigger-phrase: ^(recheck|reverify)$
176 only-trigger-phrase: false
177 status-context: "Github Release Verify"
180 white-list-target-branches:
182 included-regions: "{obj:github_included_regions}"
188 - lf_release_merge: &lf_release_merge
189 name: lf-release-merge
191 ######################
192 # Default parameters #
193 ######################
195 build-days-to-keep: 7
198 git-url: "$GIT_URL/$PROJECT"
199 use-release-file: true
201 gerrit_merge_triggers:
202 - change-merged-event
203 - comment-added-contains-event:
204 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
206 github_included_regions:
207 - '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
209 #####################
210 # Job Configuration #
211 #####################
213 disabled: "{disable-job}"
216 - lf-infra-parameters:
218 branch: "$GERRIT_BRANCH"
219 stream: "$GERRIT_BRANCH"
220 - lf-build-with-parameters-maven-release:
221 use-release-file: "{use-release-file}"
226 Tag Gerrit repo after release.
231 If DRY_RUN is enabled artifacts are not published.
236 condition-kind: regex-match
237 regex: "^.*-docker-.*"
238 label: "{build-node}"
240 - lf-provide-maven-settings:
241 global-settings-file: "global-settings"
242 settings-file: "{mvn-settings}"
243 - shell: !include-raw-escape: ../shell/docker-login.sh
244 - lf-provide-maven-settings-cleanup
245 - config-file-provider:
247 - file-id: sigul-config
248 variable: SIGUL_CONFIG
249 - file-id: sigul-password
250 variable: SIGUL_PASSWORD
253 - file-id: signing-pubkey
254 variable: SIGNING_PUBKEY
255 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
256 - shell: !include-raw-escape: ../shell/sigul-install.sh
260 name: "{project-name}-release-merge"
261 id: gerrit-release-merge
262 <<: *lf_release_common
263 # yamllint disable-line rule:key-duplicates
264 <<: *lf_release_merge
268 build-timeout: "{build-timeout}"
269 jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
272 - lf-infra-gerrit-scm:
273 jenkins-ssh-credential: "{jenkins-ssh-credential}"
275 refspec: "$GERRIT_REFSPEC"
276 branch: "$GERRIT_BRANCH"
277 submodule-disable: true
278 submodule-recursive: false
279 submodule-timeout: 10
280 # release merge jobs build from commit not tip
281 choosing-strategy: gerrit
285 server-name: "{gerrit-server-name}"
286 trigger-on: "{obj:gerrit_merge_triggers}"
288 - project-compare-type: "ANT"
289 project-pattern: "{project}"
291 - branch-compare-type: "ANT"
294 - compare-type: REG_EXP
295 pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
298 name: "{project-name}-release-merge"
299 id: github-release-merge
300 <<: *lf_release_common
301 # yamllint disable-line rule:key-duplicates
302 <<: *lf_release_merge
305 - lf-infra-properties:
306 build-days-to-keep: "{build-days-to-keep}"
308 url: "{github-url}/{github-org}/{project}"
312 build-timeout: "{build-timeout}"
313 jenkins-ssh-credential: "{jenkins-ssh-credential}"
316 - lf-infra-github-scm:
317 url: "{git-clone-url}{github-org}/{project}"
318 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
320 submodule-recursive: "{submodule-recursive}"
321 submodule-timeout: "{submodule-timeout}"
322 submodule-disable: "{submodule-disable}"
323 choosing-strategy: default
324 jenkins-ssh-credential: "{jenkins-ssh-credential}"
327 - github-pull-request:
328 trigger-phrase: "^remerge$"
329 only-trigger-phrase: true
330 status-context: "Github Release Merge"
333 white-list-target-branches:
335 included-regions: "{obj:github_included_regions}"
341 - lf_pypi_verify_wrappers: &lf_pypi_verify_wrappers
342 name: lf-pypi-verify-wrappers
346 build-timeout: "{build-timeout}"
347 jenkins-ssh-credential: "{jenkins-ssh-credential}"
349 - lf_pypi_release_wrappers: &lf_pypi_release_wrappers
350 name: lf-pypi-release-wrappers
354 build-timeout: "{build-timeout}"
355 jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
357 - lf_pypi_release: &lf_pypi_release
358 name: lf-pypi-release
360 ######################
361 # Default parameters #
362 ######################
364 branch: master # for github
365 build-days-to-keep: 7
368 gerrit-skip-vote: false
369 git-url: "$GIT_URL/$PROJECT"
370 github-url: "https://github.com"
372 pypi-stage-index: https://test.pypi.org/simple
373 submodule-disable: true
374 submodule-recursive: false
375 submodule-timeout: 10
376 use-release-file: true
378 # define once and use twice; jobs MUST NOT override
379 gerrit_release_trigger_file_paths:
380 - compare-type: REG_EXP
381 pattern: '(releases\/pypi.*\.yaml|\.releases\/pypi.*\.yaml)'
383 # yamllint disable-line rule:line-length
384 # github_release_included_regions MUST match gerrit_release_trigger_file_paths
385 github_release_included_regions:
386 - 'releases\/pypi.*\.yaml'
387 - '.releases\/pypi.*\.yaml'
390 - lf-infra-parameters:
392 branch: "$GERRIT_BRANCH"
393 stream: "$GERRIT_BRANCH"
394 # accept all entries defined in the release-yaml file
396 name: DISTRIBUTION_TYPE
398 description: "The Jenkins release job distribution type."
402 description: "The partial path of logs from the PyPI merge job."
406 description: "Tag to push to git repo; optional, defaults to VERSION."
410 description: "The PyPI project name."
414 description: "The Python compatibility version, example: 3.6"
418 description: "The module version, example: 1.0.0"
419 # special parameters for manual use of the Jenkins job
421 name: USE_RELEASE_FILE
423 description: "Set to False (unchecked) to build with parameters"
428 Tag Gerrit repo after release.
432 description: "Set to True (checked) to skip uploading artifacts"
436 - config-file-provider:
438 - file-id: sigul-config
439 variable: SIGUL_CONFIG
440 - file-id: sigul-password
441 variable: SIGUL_PASSWORD
444 - file-id: signing-pubkey
445 variable: SIGNING_PUBKEY
447 target: "$HOME/.pypirc"
448 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
449 - shell: !include-raw-escape: ../shell/sigul-install.sh
451 properties-content: |
452 PYPI_INDEX={pypi-stage-index}
453 REPOSITORY={pypi-repo}
454 - shell: !include-raw-escape: ../shell/release-job.sh
457 name: "{project-name}-pypi-release-merge"
458 id: gerrit-pypi-release-merge
459 <<: *lf_release_common
460 <<: *lf_pypi_release_wrappers
464 - lf-infra-gerrit-scm:
465 jenkins-ssh-credential: "{jenkins-ssh-credential}"
467 refspec: "$GERRIT_REFSPEC"
468 branch: "$GERRIT_BRANCH"
469 submodule-recursive: "{submodule-recursive}"
470 submodule-timeout: "{submodule-timeout}"
471 submodule-disable: "{submodule-disable}"
472 # release merge jobs build from commit not tip
473 choosing-strategy: gerrit
477 server-name: "{gerrit-server-name}"
479 - change-merged-event
480 - comment-added-contains-event:
481 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
483 - project-compare-type: "ANT"
484 project-pattern: "{project}"
486 - branch-compare-type: ANT
488 file-paths: "{obj:gerrit_release_trigger_file_paths}"
491 name: "{project-name}-pypi-release-merge"
492 id: github-pypi-release-merge
493 <<: *lf_release_common
494 <<: *lf_pypi_release_wrappers
499 url: "{github-url}/{github-org}/{project}"
502 - lf-infra-github-scm:
503 url: "{git-clone-url}{github-org}/{project}"
505 branch: "refs/heads/{branch}"
506 submodule-recursive: "{submodule-recursive}"
507 submodule-timeout: "{submodule-timeout}"
508 submodule-disable: "{submodule-disable}"
509 choosing-strategy: default
510 jenkins-ssh-credential: "{jenkins-ssh-credential}"
513 - github-pull-request:
514 trigger-phrase: "^(remerge)$"
515 only-trigger-phrase: false
516 status-context: "PyPI Release Merge"
519 white-list-target-branches:
521 included-regions: "{obj:github_release_included_regions}"
524 name: "{project-name}-pypi-release-verify"
525 id: gerrit-pypi-release-verify
526 <<: *lf_release_common
527 <<: *lf_pypi_verify_wrappers
531 - lf-infra-gerrit-scm:
532 jenkins-ssh-credential: "{jenkins-ssh-credential}"
534 refspec: "$GERRIT_REFSPEC"
535 branch: "$GERRIT_BRANCH"
536 submodule-recursive: "{submodule-recursive}"
537 submodule-timeout: "{submodule-timeout}"
538 submodule-disable: "{submodule-disable}"
539 choosing-strategy: gerrit
543 server-name: "{gerrit-server-name}"
545 - patchset-created-event:
547 exclude-trivial-rebase: false
548 exclude-no-code-change: false
549 - draft-published-event
550 - comment-added-contains-event:
551 # yamllint disable-line rule:line-length
552 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
554 - project-compare-type: "ANT"
555 project-pattern: "{project}"
557 - branch-compare-type: ANT
559 file-paths: "{obj:gerrit_release_trigger_file_paths}"
562 name: "{project-name}-pypi-release-verify"
563 id: github-pypi-release-verify
564 <<: *lf_release_common
565 <<: *lf_pypi_verify_wrappers
570 url: "{github-url}/{github-org}/{project}"
573 - lf-infra-github-scm:
574 url: "{git-clone-url}{github-org}/{project}"
576 branch: "refs/heads/{branch}"
577 submodule-recursive: "{submodule-recursive}"
578 submodule-timeout: "{submodule-timeout}"
579 submodule-disable: "{submodule-disable}"
580 choosing-strategy: default
581 jenkins-ssh-credential: "{jenkins-ssh-credential}"
584 - github-pull-request:
585 trigger-phrase: "^(recheck|reverify)$"
586 only-trigger-phrase: false
587 status-context: "PyPI Release Verify"
590 white-list-target-branches:
592 included-regions: "{obj:github_release_included_regions}"
594 ########################
595 # PackageCloud RELEASE #
596 ########################
598 - lf_packagecloud_release_common: &lf_packagecloud_release_common
599 name: lf-packagecloud-release-common
601 ######################
602 # Default parameters #
603 ######################
605 build-days-to-keep: 7
608 git-url: "$GIT_URL/$PROJECT"
609 gerrit-skip-vote: false
610 use-release-file: true
611 account-name: "{account-name}"
612 source-repo: "{source-repo}"
614 #####################
615 # Job Configuration #
616 #####################
618 disabled: "{disable-job}"
621 - lf-infra-parameters:
623 branch: "$GERRIT_BRANCH"
624 stream: "$GERRIT_BRANCH"
626 name: DISTRIBUTION_TYPE
627 default: "packagecloud"
628 description: "The Jenkins release job distribution type."
633 Tag Gerrit repo after release.
638 If DRY_RUN is enabled artifacts are not promoted.
640 name: USE_RELEASE_FILE
641 default: "{use-release-file}"
642 description: "Set to False for job built with parameters"
646 - config-file-provider:
648 - file-id: sigul-config
649 variable: SIGUL_CONFIG
650 - file-id: sigul-password
651 variable: SIGUL_PASSWORD
654 - file-id: signing-pubkey
655 variable: SIGNING_PUBKEY
656 - file-id: "packagecloud_api"
657 target: "$HOME/packagecloud_api"
658 - file-id: packagecloud-account
659 variable: ACCOUNT_NAME_FILE
660 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
661 - shell: !include-raw-escape: ../shell/sigul-install.sh
665 name: "{project-name}-packagecloud-release-verify"
666 id: gerrit-packagecloud-release-verify
667 <<: *lf_release_common
668 <<: *lf_packagecloud_release_common
672 build-timeout: "{build-timeout}"
673 jenkins-ssh-credential: "{jenkins-ssh-credential}"
676 - lf-infra-gerrit-scm:
678 refspec: "$GERRIT_REFSPEC"
679 branch: "$GERRIT_BRANCH"
680 submodule-disable: true
681 submodule-recursive: false
682 submodule-timeout: 10
683 choosing-strategy: gerrit
684 jenkins-ssh-credential: "{jenkins-ssh-credential}"
688 server-name: "{gerrit-server-name}"
690 - patchset-created-event:
692 exclude-trivial-rebase: false
693 exclude-no-code-change: false
694 - draft-published-event
695 - comment-added-contains-event:
696 # yamllint disable-line rule:line-length
697 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
699 - project-compare-type: "ANT"
700 project-pattern: "{project}"
702 - branch-compare-type: "ANT"
705 - compare-type: REG_EXP
706 pattern: '(releases\/packagecloud.*\.yaml|\.releases\/packagecloud.*\.yaml)'
708 successful: "{gerrit-skip-vote}"
709 failed: "{gerrit-skip-vote}"
710 unstable: "{gerrit-skip-vote}"
711 notbuilt: "{gerrit-skip-vote}"
714 name: "{project-name}-packagecloud-release-merge"
715 id: gerrit-packagecloud-release-merge
716 <<: *lf_release_common
717 <<: *lf_packagecloud_release_common
721 build-timeout: "{build-timeout}"
722 jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
725 - lf-infra-gerrit-scm:
726 jenkins-ssh-credential: "{jenkins-ssh-credential}"
728 refspec: "$GERRIT_REFSPEC"
729 branch: "$GERRIT_BRANCH"
730 submodule-disable: true
731 submodule-recursive: false
732 submodule-timeout: 10
733 # release merge jobs build from commit not tip
734 choosing-strategy: gerrit
738 server-name: "{gerrit-server-name}"
740 - change-merged-event
741 - comment-added-contains-event:
742 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
744 - project-compare-type: "ANT"
745 project-pattern: "{project}"
747 - branch-compare-type: "ANT"
750 - compare-type: REG_EXP
751 pattern: '(releases\/packagecloud.*\.yaml|\.releases\/packagecloud.*\.yaml)'