From 5cda87d5bea1c02ea677337e9ede58553351c55b Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Tue, 12 Jul 2022 05:04:21 +0800 Subject: [PATCH] fix pipeline failure for release test Signed-off-by: Benjamin Wang --- scripts/build-binary.sh | 10 ++++++---- scripts/release.sh | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/build-binary.sh b/scripts/build-binary.sh index e67e11e23719..cc757a65481f 100755 --- a/scripts/build-binary.sh +++ b/scripts/build-binary.sh @@ -2,8 +2,11 @@ set -e +source ./scripts/test_lib.sh + VER=$1 PROJ="etcd" +REPOSITORY="${REPOSITORY:-https://github.com/etcd-io/etcd.git}" if [ -z "$1" ]; then echo "Usage: ${0} VERSION" >> /dev/stderr @@ -17,13 +20,12 @@ function setup_env { local ver=${2} if [ ! -d "${proj}" ]; then - git clone https://github.com/etcd-io/"${proj}" + log_callout "Cloning ${REPOSITORY}..." + git clone "${REPOSITORY}" fi pushd "${proj}" >/dev/null - git checkout main git fetch --all - git reset --hard origin/main git checkout "${ver}" popd >/dev/null } @@ -53,7 +55,7 @@ function package { } function main { - mkdir release + mkdir -p release cd release setup_env "${PROJ}" "${VER}" diff --git a/scripts/release.sh b/scripts/release.sh index 1900b5524254..d68f9015a7ef 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -106,8 +106,9 @@ main() { if [[ -n $(git status -s) ]]; then log_callout "Committing version/version.go update." git add version/version.go + git diff --staged | cat git commit --signoff -m "version: bump up to ${VERSION}" - git diff --staged + git diff --staged | cat fi # Push the version change if it's not already been pushed. @@ -163,7 +164,7 @@ main() { log_callout "Building release..." # Check for old and new names of the release build script. # TODO: Move the release script into this on as a function? - ./scripts/build-release.sh "${RELEASE_VERSION}" + REPOSITORY=$(pwd) ./scripts/build-release.sh "${RELEASE_VERSION}" fi # Sanity checks.