From d0c1cf47b999c408d4df99be9a9b5fa89641bf58 Mon Sep 17 00:00:00 2001 From: Diego Lemos Date: Tue, 21 Sep 2021 11:08:07 +0100 Subject: [PATCH] [bug] `bbr -v` now displays final version [fixes #179654999] --- ci/pipelines/bbr/pipeline.yml | 7 ++++++- ci/tasks/bbr-build/task.sh | 16 +++++++++------- ci/tasks/bbr-build/task.yml | 3 ++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ci/pipelines/bbr/pipeline.yml b/ci/pipelines/bbr/pipeline.yml index 1dcd6b8a2..1c69051fa 100644 --- a/ci/pipelines/bbr/pipeline.yml +++ b/ci/pipelines/bbr/pipeline.yml @@ -565,12 +565,17 @@ jobs: - get: release-candidate-version params: pre: rc + - get: next-release-version + resource: release-candidate-version + params: + bump: final - task: build-bbr file: main/ci/tasks/bbr-build/task.yml params: GITHUB_SDK_PRIVATE_KEY: ((github-sdk.key)) input_mapping: - version: release-candidate-version + release-version: next-release-version + release-candidate-version: release-candidate-version bosh-backup-and-restore: main - task: build-s3-config-validator file: main/ci/tasks/bbr-s3-config-validator-build/task.yml diff --git a/ci/tasks/bbr-build/task.sh b/ci/tasks/bbr-build/task.sh index dd5731f84..0c5b59e49 100755 --- a/ci/tasks/bbr-build/task.sh +++ b/ci/tasks/bbr-build/task.sh @@ -2,14 +2,17 @@ set -eu -[ -d 'version' ] +[ -d 'bosh-backup-and-restore' ] +[ -d 'release-candidate-version' ] +[ -d 'release-version' ] eval "$(ssh-agent)" echo -e "${GITHUB_SDK_PRIVATE_KEY}" > "${PWD}/github-sdk.key" chmod 400 "${PWD}/github-sdk.key" ssh-add "${PWD}/github-sdk.key" -VERSION=$(cat version/number) +RELEASE_CANDIDATE_VERSION=$(cat release-candidate-version/number) +VERSION=$(cat release-version/number) export VERSION BBR_REPO="bosh-backup-and-restore" @@ -25,22 +28,21 @@ echo "The release directory now contains the following files:" ls -R bbr-release echo "Creating release tarball..." -tar -C bbr-release -cf "bbr-build/bbr-$VERSION.tar" . - +tar -C bbr-release -cf "bbr-build/bbr-$RELEASE_CANDIDATE_VERSION.tar" . echo "Auto-delivered in -https://s3-eu-west-1.amazonaws.com/bosh-backup-and-restore-builds/bbr-$VERSION.tar +https://s3-eu-west-1.amazonaws.com/bosh-backup-and-restore-builds/bbr-$RELEASE_CANDIDATE_VERSION.tar [Backup and Restore Bot]" > bbr-build/message echo "Moving linux binary to the build directory..." -LINUX="bbr-$VERSION-linux-amd64" +LINUX="bbr-$RELEASE_CANDIDATE_VERSION-linux-amd64" mv "$BBR_REPO"/releases/bbr bbr-build/"$LINUX" cat "$BBR_REPO"/releases/checksum.sha256 | cut -d' ' -f1 | sed -n '1p' > bbr-build/"$LINUX".sha256 echo "Moving mac binary to the build directory..." -DARWIN="bbr-$VERSION-darwin-amd64" +DARWIN="bbr-$RELEASE_CANDIDATE_VERSION-darwin-amd64" mv "$BBR_REPO"/releases/bbr-mac bbr-build/"$DARWIN" cat "$BBR_REPO"/releases/checksum.sha256 | cut -d' ' -f1 | sed -n '2p' > bbr-build/"$DARWIN".sha256 diff --git a/ci/tasks/bbr-build/task.yml b/ci/tasks/bbr-build/task.yml index b657aea6a..000ef8ad8 100644 --- a/ci/tasks/bbr-build/task.yml +++ b/ci/tasks/bbr-build/task.yml @@ -7,7 +7,8 @@ image_resource: inputs: - name: bosh-backup-and-restore -- name: version +- name: release-candidate-version +- name: release-version params: GITHUB_SDK_PRIVATE_KEY: