diff --git a/ci/finalize-release.yml b/ci/finalize-release.yml deleted file mode 100644 index 7de265a2..00000000 --- a/ci/finalize-release.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -platform: linux - -image_resource: - type: registry-image - source: - repository: concourse/bosh-cli - -inputs: -- name: bpm-release -- name: version - -outputs: -- name: final-release-repo -- name: final-release-tarball -- name: final-release-tag - -params: - RELEASE_NAME: - BLOBSTORE_PRIVATE_YML: - -run: - path: bpm-release/ci/scripts/finalize-release - diff --git a/ci/pipelines/bpm.yml b/ci/pipelines/bpm.yml index 4b15486d..b8a11006 100644 --- a/ci/pipelines/bpm.yml +++ b/ci/pipelines/bpm.yml @@ -7,6 +7,13 @@ resource_types: password: ((docker.password)) resources: +- name: bosh-integration-image + type: registry-image + source: + repository: bosh/integration + username: ((dockerhub_username)) + password: ((dockerhub_password)) + - name: bpm-release type: git source: @@ -325,6 +332,8 @@ jobs: serial_groups: [version] plan: - in_parallel: + - get: bosh-shared-ci + - get: bosh-integration-image - get: bpm-release passed: - pre-release-fan-in @@ -337,12 +346,15 @@ jobs: - task: bump-local-version file: bpm-release/ci/bump-local-version.yml - task: finalize-release - file: bpm-release/ci/finalize-release.yml + file: bosh-shared-ci/tasks/release/create-final-release.yml + image: bosh-integration-image input_mapping: - bpm-release: release-repo + release_repo: release-repo + version: version params: - RELEASE_NAME: bpm - BLOBSTORE_PRIVATE_YML: | + GIT_USER_NAME: CI Bot + GIT_USER_EMAIL: bots@cloudfoundry.org + PRIVATE_YML: | --- blobstore: options: @@ -352,22 +364,21 @@ jobs: get_params: submodules: none params: - repository: final-release-repo + repository: release_repo submodules: none rebase: true - tag: version/version - tag_prefix: v + tag: release_metadata/tag-name - put: github-release params: - name: final-release-tag/tag - tag: final-release-tag/tag + name: release_metadata/tag-name + tag: release_metadata/tag-name body: release-notes/release-notes.md commitish: bpm-release/.git/ref generate_release_notes: true - task: bump-local-version file: bpm-release/ci/bump-local-version.yml input_mapping: - bpm-release: final-release-repo + bpm-release: release_repo params: DEV: true - put: bpm-release diff --git a/ci/scripts/finalize-release b/ci/scripts/finalize-release deleted file mode 100755 index f61d3f86..00000000 --- a/ci/scripts/finalize-release +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -e - -# inputs -BOSH_RELEASE_DIR=$PWD/bpm-release - -# outputs -FINAL_RELEASE_TARBALL_DIR="${PWD}/final-release-tarball" -FINAL_RELEASE_REPO="${PWD}/final-release-repo" -FINAL_RELEASE_TAG="${PWD}/final-release-tag" - -VERSION=$(cat ./version/version) -if [ -z "$VERSION" ]; then - echo "Version number not found in ./version/version" - exit 1 -fi - -FINAL_RELEASE_TARBALL="${FINAL_RELEASE_TARBALL_DIR}/${RELEASE_NAME}-${VERSION}.tgz" - -# This is necessary in order to copy hidden files -shopt -s dotglob -cp -r "${BOSH_RELEASE_DIR}"/* "${FINAL_RELEASE_REPO}" - -{ - IFS='' - echo "$BLOBSTORE_PRIVATE_YML" >> "$FINAL_RELEASE_REPO/config/private.yml" -} - -git config --global user.email "cf-bpm+final-releaser@pivotal.io" -git config --global user.name "CF BPM" - -cd "$FINAL_RELEASE_REPO" - -RELEASE_YML=$PWD/releases/$RELEASE_NAME/$RELEASE_NAME-${VERSION}.yml - -# be idempotent -if ! [ -e "${RELEASE_YML}" ]; then - echo "creating final release" - bosh -n create-release --final --version "${VERSION}" - git add -A - git commit -m "release v${VERSION}" - git tag -f "v${VERSION}" -fi - -bosh -n create-release --tarball "${FINAL_RELEASE_TARBALL}" "${RELEASE_YML}" - -echo "v${VERSION}" > "${FINAL_RELEASE_TAG}/tag"