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*$'
63 disabled: "{disable-job}"
66 - lf-infra-parameters:
68 branch: "$GERRIT_BRANCH"
69 stream: "$GERRIT_BRANCH"
70 - lf-build-with-parameters-maven-release:
71 use-release-file: "{use-release-file}"
76 condition-kind: regex-match
77 regex: "^.*-docker-.*"
80 - lf-provide-maven-settings:
81 global-settings-file: "global-settings"
82 settings-file: "{mvn-settings}"
83 - shell: !include-raw-escape: ../shell/docker-login.sh
84 - lf-provide-maven-settings-cleanup
85 - config-file-provider:
87 - file-id: sigul-config
88 variable: SIGUL_CONFIG
89 - file-id: sigul-password
90 variable: SIGUL_PASSWORD
93 - file-id: signing-pubkey
94 variable: SIGNING_PUBKEY
95 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
96 - shell: !include-raw-escape: ../shell/sigul-install.sh
100 name: "{project-name}-release-verify"
101 id: gerrit-release-verify
102 <<: *lf_release_common
103 # yamllint disable-line rule:key-duplicates
104 <<: *lf_release_verify
108 build-timeout: "{build-timeout}"
109 jenkins-ssh-credential: "{jenkins-ssh-credential}"
112 - lf-infra-gerrit-scm:
114 refspec: "$GERRIT_REFSPEC"
115 branch: "$GERRIT_BRANCH"
116 submodule-disable: true
117 submodule-recursive: false
118 submodule-timeout: 10
119 choosing-strategy: gerrit
120 jenkins-ssh-credential: "{jenkins-ssh-credential}"
124 server-name: "{gerrit-server-name}"
125 trigger-on: "{obj:gerrit_verify_triggers}"
127 - project-compare-type: "ANT"
128 project-pattern: "{project}"
130 - branch-compare-type: "ANT"
133 - compare-type: REG_EXP
134 pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
136 successful: "{gerrit-skip-vote}"
137 failed: "{gerrit-skip-vote}"
138 unstable: "{gerrit-skip-vote}"
139 notbuilt: "{gerrit-skip-vote}"
145 - lf_release_merge: &lf_release_merge
146 name: lf-release-merge
148 ######################
149 # Default parameters #
150 ######################
152 build-days-to-keep: 7
155 git-url: "$GIT_URL/$PROJECT"
156 use-release-file: true
158 gerrit_merge_triggers:
159 - change-merged-event
160 - comment-added-contains-event:
161 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
163 #####################
164 # Job Configuration #
165 #####################
167 disabled: "{disable-job}"
170 - lf-infra-parameters:
172 branch: "$GERRIT_BRANCH"
173 stream: "$GERRIT_BRANCH"
174 - lf-build-with-parameters-maven-release:
175 use-release-file: "{use-release-file}"
180 If DRY_RUN is enabled artifacts are not published.
185 condition-kind: regex-match
186 regex: "^.*-docker-.*"
187 label: "{build-node}"
189 - lf-provide-maven-settings:
190 global-settings-file: "global-settings"
191 settings-file: "{mvn-settings}"
192 - shell: !include-raw-escape: ../shell/docker-login.sh
193 - lf-provide-maven-settings-cleanup
194 - config-file-provider:
196 - file-id: sigul-config
197 variable: SIGUL_CONFIG
198 - file-id: sigul-password
199 variable: SIGUL_PASSWORD
202 - file-id: signing-pubkey
203 variable: SIGNING_PUBKEY
204 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
205 - shell: !include-raw-escape: ../shell/sigul-install.sh
209 name: "{project-name}-release-merge"
210 id: gerrit-release-merge
211 <<: *lf_release_common
212 # yamllint disable-line rule:key-duplicates
213 <<: *lf_release_merge
217 build-timeout: "{build-timeout}"
218 jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
221 - lf-infra-gerrit-scm:
222 jenkins-ssh-credential: "{jenkins-ssh-credential}"
224 refspec: "$GERRIT_REFSPEC"
225 branch: "$GERRIT_BRANCH"
226 submodule-disable: true
227 submodule-recursive: false
228 submodule-timeout: 10
229 # release merge jobs build from commit not tip
230 choosing-strategy: gerrit
234 server-name: "{gerrit-server-name}"
235 trigger-on: "{obj:gerrit_merge_triggers}"
237 - project-compare-type: "ANT"
238 project-pattern: "{project}"
240 - branch-compare-type: "ANT"
243 - compare-type: REG_EXP
244 pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
250 - lf_pypi_verify_wrappers: &lf_pypi_verify_wrappers
251 name: lf-pypi-verify-wrappers
255 build-timeout: "{build-timeout}"
256 jenkins-ssh-credential: "{jenkins-ssh-credential}"
258 - lf_pypi_release_wrappers: &lf_pypi_release_wrappers
259 name: lf-pypi-release-wrappers
263 build-timeout: "{build-timeout}"
264 jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
266 - lf_pypi_release: &lf_pypi_release
267 name: lf-pypi-release
269 ######################
270 # Default parameters #
271 ######################
273 branch: master # for github
274 build-days-to-keep: 7
277 gerrit-skip-vote: false
278 git-url: "$GIT_URL/$PROJECT"
279 github-url: "https://github.com"
281 pypi-stage-index: https://test.pypi.org/simple
282 submodule-disable: true
283 submodule-recursive: false
284 submodule-timeout: 10
285 use-release-file: true
287 # define once and use twice; jobs MUST NOT override
288 gerrit_release_trigger_file_paths:
289 - compare-type: REG_EXP
290 pattern: '(releases\/pypi.*\.yaml|\.releases\/pypi.*\.yaml)'
292 # yamllint disable-line rule:line-length
293 # github_release_included_regions MUST match gerrit_release_trigger_file_paths
294 github_release_included_regions:
295 - 'releases\/pypi.*\.yaml'
296 - '.releases\/pypi.*\.yaml'
299 - lf-infra-parameters:
301 branch: "$GERRIT_BRANCH"
302 stream: "$GERRIT_BRANCH"
303 # accept all entries defined in the release-yaml file
305 name: DISTRIBUTION_TYPE
307 description: "The Jenkins release job distribution type."
311 description: "The partial path of logs from the PyPI merge job."
315 description: "Tag to push to git repo; optional, defaults to VERSION."
319 description: "The PyPI project name."
323 description: "The Python compatibility version, example: 3.6"
327 description: "The module version, example: 1.0.0"
328 # special parameters for manual use of the Jenkins job
330 name: USE_RELEASE_FILE
332 description: "Set to False (unchecked) to build with parameters"
336 description: "Set to True (checked) to skip uploading artifacts"
340 - config-file-provider:
342 - file-id: sigul-config
343 variable: SIGUL_CONFIG
344 - file-id: sigul-password
345 variable: SIGUL_PASSWORD
348 - file-id: signing-pubkey
349 variable: SIGNING_PUBKEY
351 target: "$HOME/.pypirc"
352 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
353 - shell: !include-raw-escape: ../shell/sigul-install.sh
355 properties-content: |
356 PYPI_INDEX={pypi-stage-index}
357 REPOSITORY={pypi-repo}
358 - shell: !include-raw-escape: ../shell/release-job.sh
361 name: "{project-name}-pypi-release-merge"
362 id: gerrit-pypi-release-merge
363 <<: *lf_release_common
364 <<: *lf_pypi_release_wrappers
368 - lf-infra-gerrit-scm:
369 jenkins-ssh-credential: "{jenkins-ssh-credential}"
371 refspec: "$GERRIT_REFSPEC"
372 branch: "$GERRIT_BRANCH"
373 submodule-recursive: "{submodule-recursive}"
374 submodule-timeout: "{submodule-timeout}"
375 submodule-disable: "{submodule-disable}"
376 # release merge jobs build from commit not tip
377 choosing-strategy: gerrit
381 server-name: "{gerrit-server-name}"
383 - change-merged-event
384 - comment-added-contains-event:
385 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
387 - project-compare-type: "ANT"
388 project-pattern: "{project}"
390 - branch-compare-type: ANT
392 file-paths: "{obj:gerrit_release_trigger_file_paths}"
395 name: "{project-name}-pypi-release-merge"
396 id: github-pypi-release-merge
397 <<: *lf_release_common
398 <<: *lf_pypi_release_wrappers
403 url: "{github-url}/{github-org}/{project}"
406 - lf-infra-github-scm:
407 url: "{git-clone-url}{github-org}/{project}"
409 branch: "refs/heads/{branch}"
410 submodule-recursive: "{submodule-recursive}"
411 submodule-timeout: "{submodule-timeout}"
412 submodule-disable: "{submodule-disable}"
413 choosing-strategy: default
414 jenkins-ssh-credential: "{jenkins-ssh-credential}"
417 - github-pull-request:
418 trigger-phrase: "^(remerge)$"
419 only-trigger-phrase: false
420 status-context: "PyPI Release Merge"
423 white-list-target-branches:
425 included-regions: "{obj:github_release_included_regions}"
428 name: "{project-name}-pypi-release-verify"
429 id: gerrit-pypi-release-verify
430 <<: *lf_release_common
431 <<: *lf_pypi_verify_wrappers
435 - lf-infra-gerrit-scm:
436 jenkins-ssh-credential: "{jenkins-ssh-credential}"
438 refspec: "$GERRIT_REFSPEC"
439 branch: "$GERRIT_BRANCH"
440 submodule-recursive: "{submodule-recursive}"
441 submodule-timeout: "{submodule-timeout}"
442 submodule-disable: "{submodule-disable}"
443 choosing-strategy: gerrit
447 server-name: "{gerrit-server-name}"
449 - patchset-created-event:
451 exclude-trivial-rebase: false
452 exclude-no-code-change: false
453 - draft-published-event
454 - comment-added-contains-event:
455 # yamllint disable-line rule:line-length
456 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
458 - project-compare-type: "ANT"
459 project-pattern: "{project}"
461 - branch-compare-type: ANT
463 file-paths: "{obj:gerrit_release_trigger_file_paths}"
466 name: "{project-name}-pypi-release-verify"
467 id: github-pypi-release-verify
468 <<: *lf_release_common
469 <<: *lf_pypi_verify_wrappers
474 url: "{github-url}/{github-org}/{project}"
477 - lf-infra-github-scm:
478 url: "{git-clone-url}{github-org}/{project}"
480 branch: "refs/heads/{branch}"
481 submodule-recursive: "{submodule-recursive}"
482 submodule-timeout: "{submodule-timeout}"
483 submodule-disable: "{submodule-disable}"
484 choosing-strategy: default
485 jenkins-ssh-credential: "{jenkins-ssh-credential}"
488 - github-pull-request:
489 trigger-phrase: "^(recheck|reverify)$"
490 only-trigger-phrase: false
491 status-context: "PyPI Release Verify"
494 white-list-target-branches:
496 included-regions: "{obj:github_release_included_regions}"
498 ########################
499 # PackageCloud RELEASE #
500 ########################
502 - lf_packagecloud_release_common: &lf_packagecloud_release_common
503 name: lf-packagecloud-release-common
505 ######################
506 # Default parameters #
507 ######################
509 build-days-to-keep: 7
512 git-url: "$GIT_URL/$PROJECT"
513 gerrit-skip-vote: false
514 use-release-file: true
515 account-name: "{account-name}"
516 source-repo: "{source-repo}"
518 #####################
519 # Job Configuration #
520 #####################
522 disabled: "{disable-job}"
525 - lf-infra-parameters:
527 branch: "$GERRIT_BRANCH"
528 stream: "$GERRIT_BRANCH"
530 name: DISTRIBUTION_TYPE
531 default: "packagecloud"
532 description: "The Jenkins release job distribution type."
537 If DRY_RUN is enabled artifacts are not promoted.
539 name: USE_RELEASE_FILE
540 default: "{use-release-file}"
541 description: "Set to False for job built with parameters"
545 - config-file-provider:
547 - file-id: sigul-config
548 variable: SIGUL_CONFIG
549 - file-id: sigul-password
550 variable: SIGUL_PASSWORD
553 - file-id: signing-pubkey
554 variable: SIGNING_PUBKEY
555 - file-id: "packagecloud_api"
556 target: "$HOME/packagecloud_api"
557 - file-id: packagecloud-account
558 variable: ACCOUNT_NAME_FILE
559 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
560 - shell: !include-raw-escape: ../shell/sigul-install.sh
564 name: "{project-name}-packagecloud-release-verify"
565 id: gerrit-packagecloud-release-verify
566 <<: *lf_release_common
567 <<: *lf_packagecloud_release_common
571 build-timeout: "{build-timeout}"
572 jenkins-ssh-credential: "{jenkins-ssh-credential}"
575 - lf-infra-gerrit-scm:
577 refspec: "$GERRIT_REFSPEC"
578 branch: "$GERRIT_BRANCH"
579 submodule-disable: true
580 submodule-recursive: false
581 submodule-timeout: 10
582 choosing-strategy: gerrit
583 jenkins-ssh-credential: "{jenkins-ssh-credential}"
587 server-name: "{gerrit-server-name}"
589 - patchset-created-event:
591 exclude-trivial-rebase: false
592 exclude-no-code-change: false
593 - draft-published-event
594 - comment-added-contains-event:
595 # yamllint disable-line rule:line-length
596 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
598 - project-compare-type: "ANT"
599 project-pattern: "{project}"
601 - branch-compare-type: "ANT"
604 - compare-type: REG_EXP
605 pattern: '(releases\/packagecloud.*\.yaml|\.releases\/packagecloud.*\.yaml)'
607 successful: "{gerrit-skip-vote}"
608 failed: "{gerrit-skip-vote}"
609 unstable: "{gerrit-skip-vote}"
610 notbuilt: "{gerrit-skip-vote}"
613 name: "{project-name}-packagecloud-release-merge"
614 id: gerrit-packagecloud-release-merge
615 <<: *lf_release_common
616 <<: *lf_packagecloud_release_common
620 build-timeout: "{build-timeout}"
621 jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
624 - lf-infra-gerrit-scm:
625 jenkins-ssh-credential: "{jenkins-ssh-credential}"
627 refspec: "$GERRIT_REFSPEC"
628 branch: "$GERRIT_BRANCH"
629 submodule-disable: true
630 submodule-recursive: false
631 submodule-timeout: 10
632 # release merge jobs build from commit not tip
633 choosing-strategy: gerrit
637 server-name: "{gerrit-server-name}"
639 - change-merged-event
640 - comment-added-contains-event:
641 comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
643 - project-compare-type: "ANT"
644 project-pattern: "{project}"
646 - branch-compare-type: "ANT"
649 - compare-type: REG_EXP
650 pattern: '(releases\/packagecloud.*\.yaml|\.releases\/packagecloud.*\.yaml)'