X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-release-jobs.yaml;h=398a53ebd69a3ff16c190abf46101295671e5aff;hb=6b1b8ed30a5a553965664d84b2a028534e63ee59;hp=f016e37bb66ae4918109e387fc50aaa24e9de537;hpb=2a557e77bcfc2556e2eeaf383033e119de91b1b0;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-release-jobs.yaml b/jjb/lf-release-jobs.yaml index f016e37b..398a53eb 100644 --- a/jjb/lf-release-jobs.yaml +++ b/jjb/lf-release-jobs.yaml @@ -14,14 +14,6 @@ - lf_release_common: &lf_release_common name: lf-release-common - ###################### - # Default parameters # - ###################### - - gerrit_trigger_file_paths: - - compare-type: ANT - pattern: "releases/*.yaml" - ##################### # Job Configuration # ##################### @@ -33,17 +25,6 @@ - lf-infra-properties: build-days-to-keep: 7 - parameters: - - lf-infra-parameters: - project: "{project}" - branch: "master" - stream: "{stream}" - - wrappers: - - lf-infra-wrappers: - build-timeout: "{build-timeout}" - jenkins-ssh-credential: "{jenkins-ssh-release-credential}" - publishers: - lf-infra-publish @@ -58,13 +39,12 @@ # Default parameters # ###################### - branch: master - stream: master build-days-to-keep: 7 build-timeout: 15 disable-job: false git-url: "$GIT_URL/$PROJECT" gerrit-skip-vote: false + use-release-file: true gerrit_verify_triggers: - patchset-created-event: @@ -73,7 +53,8 @@ exclude-no-code-change: false - draft-published-event - comment-added-contains-event: - comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$' + # yamllint disable-line rule:line-length + comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$' ##################### # Job Configuration # @@ -81,8 +62,26 @@ disabled: "{disable-job}" + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "$GERRIT_BRANCH" + stream: "$GERRIT_BRANCH" + - lf-build-with-parameters-maven-release: + use-release-file: "{use-release-file}" + builders: - lf-infra-pre-build + - conditional-step: + condition-kind: regex-match + regex: "^.*-docker-.*" + label: "{build-node}" + steps: + - lf-provide-maven-settings: + global-settings-file: "global-settings" + settings-file: "{mvn-settings}" + - shell: !include-raw-escape: ../shell/docker-login.sh + - lf-provide-maven-settings-cleanup - config-file-provider: files: - file-id: sigul-config @@ -98,22 +97,27 @@ - lf-release - job-template: - name: "{project-name}-release-verify-{stream}" + name: "{project-name}-release-verify" id: gerrit-release-verify <<: *lf_release_common # yamllint disable-line rule:key-duplicates <<: *lf_release_verify + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-credential}" + scm: - lf-infra-gerrit-scm: git-url: "{git-url}" refspec: "$GERRIT_REFSPEC" - branch: "master" + branch: "$GERRIT_BRANCH" submodule-disable: true submodule-recursive: false submodule-timeout: 10 choosing-strategy: gerrit - jenkins-ssh-credential: "{jenkins-ssh-release-credential}" + jenkins-ssh-credential: "{jenkins-ssh-credential}" triggers: - gerrit: @@ -124,8 +128,10 @@ project-pattern: "{project}" branches: - branch-compare-type: "ANT" - branch-pattern: "**/master" - file-paths: "{obj:gerrit_trigger_file_paths}" + branch-pattern: "**" + file-paths: + - compare-type: REG_EXP + pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)' skip-vote: successful: "{gerrit-skip-vote}" failed: "{gerrit-skip-vote}" @@ -143,17 +149,16 @@ # Default parameters # ###################### - branch: master - stream: master build-days-to-keep: 7 build-timeout: 15 disable-job: false git-url: "$GIT_URL/$PROJECT" + use-release-file: true gerrit_merge_triggers: - change-merged-event - comment-added-contains-event: - comment-contains-value: remerge$ + comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$' ##################### # Job Configuration # @@ -161,8 +166,31 @@ disabled: "{disable-job}" + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "$GERRIT_BRANCH" + stream: "$GERRIT_BRANCH" + - lf-build-with-parameters-maven-release: + use-release-file: "{use-release-file}" + - bool: + name: DRY_RUN + default: false + description: | + If DRY_RUN is enabled artifacts are not published. + builders: - lf-infra-pre-build + - conditional-step: + condition-kind: regex-match + regex: "^.*-docker-.*" + label: "{build-node}" + steps: + - lf-provide-maven-settings: + global-settings-file: "global-settings" + settings-file: "{mvn-settings}" + - shell: !include-raw-escape: ../shell/docker-login.sh + - lf-provide-maven-settings-cleanup - config-file-provider: files: - file-id: sigul-config @@ -178,22 +206,28 @@ - lf-release - job-template: - name: "{project-name}-release-merge-{stream}" + name: "{project-name}-release-merge" id: gerrit-release-merge <<: *lf_release_common # yamllint disable-line rule:key-duplicates <<: *lf_release_merge + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-release-credential}" + scm: - lf-infra-gerrit-scm: - jenkins-ssh-credential: "{jenkins-ssh-release-credential}" + jenkins-ssh-credential: "{jenkins-ssh-credential}" git-url: "{git-url}" refspec: "$GERRIT_REFSPEC" branch: "$GERRIT_BRANCH" submodule-disable: true submodule-recursive: false submodule-timeout: 10 - choosing-strategy: default + # release merge jobs build from commit not tip + choosing-strategy: gerrit triggers: - gerrit: @@ -204,5 +238,413 @@ project-pattern: "{project}" branches: - branch-compare-type: "ANT" - branch-pattern: "**/master" - file-paths: "{obj:gerrit_trigger_file_paths}" + branch-pattern: "**" + file-paths: + - compare-type: REG_EXP + pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)' + +################ +# PyPI RELEASE # +################ + +- lf_pypi_verify_wrappers: &lf_pypi_verify_wrappers + name: lf-pypi-verify-wrappers + + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-credential}" + +- lf_pypi_release_wrappers: &lf_pypi_release_wrappers + name: lf-pypi-release-wrappers + + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-release-credential}" + +- lf_pypi_release: &lf_pypi_release + name: lf-pypi-release + + ###################### + # Default parameters # + ###################### + + branch: master # for github + build-days-to-keep: 7 + build-timeout: 15 + disable-job: false + gerrit-skip-vote: false + git-url: "$GIT_URL/$PROJECT" + github-url: "https://github.com" + pypi-repo: pypi + pypi-stage-index: https://test.pypi.org/simple + submodule-disable: true + submodule-recursive: false + submodule-timeout: 10 + use-release-file: true + + # define once and use twice; jobs MUST NOT override + gerrit_release_trigger_file_paths: + - compare-type: REG_EXP + pattern: '(releases\/pypi.*\.yaml|\.releases\/pypi.*\.yaml)' + + # yamllint disable-line rule:line-length + # github_release_included_regions MUST match gerrit_release_trigger_file_paths + github_release_included_regions: + - 'releases\/pypi.*\.yaml' + - '.releases\/pypi.*\.yaml' + + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "$GERRIT_BRANCH" + stream: "$GERRIT_BRANCH" + # accept all entries defined in the release-yaml file + - string: + name: DISTRIBUTION_TYPE + default: "pypi" + description: "The Jenkins release job distribution type." + - string: + name: LOG_DIR + default: "" + description: "The partial path of logs from the PyPI merge job." + - string: + name: GIT_TAG + default: "" + description: "Tag to push to git repo; optional, defaults to VERSION." + - string: + name: PYPI_PROJECT + default: "" + description: "The PyPI project name." + - string: + name: PYTHON_VERSION + default: "" + description: "The Python compatibility version, example: 3.6" + - string: + name: VERSION + default: "" + description: "The module version, example: 1.0.0" + # special parameters for manual use of the Jenkins job + - bool: + name: USE_RELEASE_FILE + default: true + description: "Set to False (unchecked) to build with parameters" + - bool: + name: DRY_RUN + default: false + description: "Set to True (checked) to skip uploading artifacts" + + builders: + - lf-infra-pre-build + - config-file-provider: + files: + - file-id: sigul-config + variable: SIGUL_CONFIG + - file-id: sigul-password + variable: SIGUL_PASSWORD + - file-id: sigul-pki + variable: SIGUL_PKI + - file-id: signing-pubkey + variable: SIGNING_PUBKEY + - file-id: pypirc + target: "$HOME/.pypirc" + - shell: !include-raw-escape: ../shell/sigul-configuration.sh + - shell: !include-raw-escape: ../shell/sigul-install.sh + - inject: + properties-content: | + PYPI_INDEX={pypi-stage-index} + REPOSITORY={pypi-repo} + - shell: !include-raw-escape: ../shell/release-job.sh + +- job-template: + name: "{project-name}-pypi-release-merge" + id: gerrit-pypi-release-merge + <<: *lf_release_common + <<: *lf_pypi_release_wrappers + <<: *lf_pypi_release + + scm: + - lf-infra-gerrit-scm: + jenkins-ssh-credential: "{jenkins-ssh-credential}" + git-url: "{git-url}" + refspec: "$GERRIT_REFSPEC" + branch: "$GERRIT_BRANCH" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + # release merge jobs build from commit not tip + choosing-strategy: gerrit + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$' + projects: + - project-compare-type: "ANT" + project-pattern: "{project}" + branches: + - branch-compare-type: ANT + branch-pattern: "**" + file-paths: "{obj:gerrit_release_trigger_file_paths}" + +- job-template: + name: "{project-name}-pypi-release-merge" + id: github-pypi-release-merge + <<: *lf_release_common + <<: *lf_pypi_release_wrappers + <<: *lf_pypi_release + + properties: + - github: + url: "{github-url}/{github-org}/{project}" + + scm: + - lf-infra-github-scm: + url: "{git-clone-url}{github-org}/{project}" + refspec: "" + branch: "refs/heads/{branch}" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + choosing-strategy: default + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + triggers: + - github-pull-request: + trigger-phrase: "^(remerge)$" + only-trigger-phrase: false + status-context: "PyPI Release Merge" + permit-all: true + github-hooks: true + white-list-target-branches: + - "{branch}" + included-regions: "{obj:github_release_included_regions}" + +- job-template: + name: "{project-name}-pypi-release-verify" + id: gerrit-pypi-release-verify + <<: *lf_release_common + <<: *lf_pypi_verify_wrappers + <<: *lf_pypi_release + + scm: + - lf-infra-gerrit-scm: + jenkins-ssh-credential: "{jenkins-ssh-credential}" + git-url: "{git-url}" + refspec: "$GERRIT_REFSPEC" + branch: "$GERRIT_BRANCH" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + choosing-strategy: gerrit + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + trigger-on: + - patchset-created-event: + exclude-drafts: true + exclude-trivial-rebase: false + exclude-no-code-change: false + - draft-published-event + - comment-added-contains-event: + # yamllint disable-line rule:line-length + comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$' + projects: + - project-compare-type: "ANT" + project-pattern: "{project}" + branches: + - branch-compare-type: ANT + branch-pattern: "**" + file-paths: "{obj:gerrit_release_trigger_file_paths}" + +- job-template: + name: "{project-name}-pypi-release-verify" + id: github-pypi-release-verify + <<: *lf_release_common + <<: *lf_pypi_verify_wrappers + <<: *lf_pypi_release + + properties: + - github: + url: "{github-url}/{github-org}/{project}" + + scm: + - lf-infra-github-scm: + url: "{git-clone-url}{github-org}/{project}" + refspec: "" + branch: "refs/heads/{branch}" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + choosing-strategy: default + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + triggers: + - github-pull-request: + trigger-phrase: "^(recheck|reverify)$" + only-trigger-phrase: false + status-context: "PyPI Release Verify" + permit-all: true + github-hooks: true + white-list-target-branches: + - "{branch}" + included-regions: "{obj:github_release_included_regions}" + +######################## +# PackageCloud RELEASE # +######################## + +- lf_packagecloud_release_common: &lf_packagecloud_release_common + name: lf-packagecloud-release-common + + ###################### + # Default parameters # + ###################### + + build-days-to-keep: 7 + build-timeout: 15 + disable-job: false + git-url: "$GIT_URL/$PROJECT" + gerrit-skip-vote: false + use-release-file: true + account-name: "{account-name}" + source-repo: "{source-repo}" + + ##################### + # Job Configuration # + ##################### + + disabled: "{disable-job}" + + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "$GERRIT_BRANCH" + stream: "$GERRIT_BRANCH" + - string: + name: DISTRIBUTION_TYPE + default: "packagecloud" + description: "The Jenkins release job distribution type." + - bool: + name: DRY_RUN + default: false + description: | + If DRY_RUN is enabled artifacts are not promoted. + - bool: + name: USE_RELEASE_FILE + default: "{use-release-file}" + description: "Set to False for job built with parameters" + + builders: + - lf-infra-pre-build + - config-file-provider: + files: + - file-id: sigul-config + variable: SIGUL_CONFIG + - file-id: sigul-password + variable: SIGUL_PASSWORD + - file-id: sigul-pki + variable: SIGUL_PKI + - file-id: signing-pubkey + variable: SIGNING_PUBKEY + - file-id: "packagecloud_api" + target: "$HOME/packagecloud_api" + - file-id: packagecloud-account + variable: ACCOUNT_NAME_FILE + - shell: !include-raw-escape: ../shell/sigul-configuration.sh + - shell: !include-raw-escape: ../shell/sigul-install.sh + - lf-release + +- job-template: + name: "{project-name}-packagecloud-release-verify" + id: gerrit-packagecloud-release-verify + <<: *lf_release_common + <<: *lf_packagecloud_release_common + + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + scm: + - lf-infra-gerrit-scm: + git-url: "{git-url}" + refspec: "$GERRIT_REFSPEC" + branch: "$GERRIT_BRANCH" + submodule-disable: true + submodule-recursive: false + submodule-timeout: 10 + choosing-strategy: gerrit + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + trigger-on: + - patchset-created-event: + exclude-drafts: true + exclude-trivial-rebase: false + exclude-no-code-change: false + - draft-published-event + - comment-added-contains-event: + # yamllint disable-line rule:line-length + comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$' + projects: + - project-compare-type: "ANT" + project-pattern: "{project}" + branches: + - branch-compare-type: "ANT" + branch-pattern: "**" + file-paths: + - compare-type: REG_EXP + pattern: '(releases\/packagecloud.*\.yaml|\.releases\/packagecloud.*\.yaml)' + skip-vote: + successful: "{gerrit-skip-vote}" + failed: "{gerrit-skip-vote}" + unstable: "{gerrit-skip-vote}" + notbuilt: "{gerrit-skip-vote}" + +- job-template: + name: "{project-name}-packagecloud-release-merge" + id: gerrit-packagecloud-release-merge + <<: *lf_release_common + <<: *lf_packagecloud_release_common + + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-release-credential}" + + scm: + - lf-infra-gerrit-scm: + jenkins-ssh-credential: "{jenkins-ssh-credential}" + git-url: "{git-url}" + refspec: "$GERRIT_REFSPEC" + branch: "$GERRIT_BRANCH" + submodule-disable: true + submodule-recursive: false + submodule-timeout: 10 + # release merge jobs build from commit not tip + choosing-strategy: gerrit + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$' + projects: + - project-compare-type: "ANT" + project-pattern: "{project}" + branches: + - branch-compare-type: "ANT" + branch-pattern: "**" + file-paths: + - compare-type: REG_EXP + pattern: '(releases\/packagecloud.*\.yaml|\.releases\/packagecloud.*\.yaml)'