From f08a310ed905367c533934cb0dea41f6fc5e42e3 Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Fri, 4 Oct 2019 13:39:27 +0800 Subject: [PATCH] HBASE-23118 [RELEASE SCRIPTS] Allow creating a RC from an existing tag[RELEASE SCRIPTS] Allow creating a RC from an existing tag (#686) Signed-off-by: stack --- dev-support/create-release/do-release.sh | 8 +++++++- dev-support/create-release/release-util.sh | 12 +++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dev-support/create-release/do-release.sh b/dev-support/create-release/do-release.sh index 58a6d8d7a1d..1c10dfc1dc0 100755 --- a/dev-support/create-release/do-release.sh +++ b/dev-support/create-release/do-release.sh @@ -57,7 +57,13 @@ export GPG_TTY=$(tty) function should_build { local WHAT=$1 - [ -z "$RELEASE_STEP" ] || [ "$WHAT" = "$RELEASE_STEP" ] + if [[ -z "$RELEASE_STEP" ]]; then + return 0 + elif [[ "$RELEASE_STEP" == *"$WHAT"* ]]; then + return 0 + else + return 1 + fi } if should_build "tag" && [ $SKIP_TAG = 0 ]; then diff --git a/dev-support/create-release/release-util.sh b/dev-support/create-release/release-util.sh index be862adca8f..5ccd31a64a4 100755 --- a/dev-support/create-release/release-util.sh +++ b/dev-support/create-release/release-util.sh @@ -126,13 +126,15 @@ function get_release_info { parse_version) echo "Current branch VERSION is $VERSION." - if [[ ! $VERSION =~ .*-SNAPSHOT ]]; then - error "Not a SNAPSHOT version: $VERSION" + NEXT_VERSION="$VERSION" + RELEASE_VERSION="" + SHORT_VERSION=$(echo "$VERSION" | cut -d . -f 1-2) + if [[ ! $VERSION =~ .*-SNAPSHOT ]]; then + RELEASE_VERSION="$VERSION" + else + RELEASE_VERSION="${VERSION/-SNAPSHOT/}" fi - NEXT_VERSION="$VERSION" - RELEASE_VERSION="${VERSION/-SNAPSHOT/}" - SHORT_VERSION=$(echo "$VERSION" | cut -d . -f 1-2) local REV=$(echo "$VERSION" | cut -d . -f 3) # Find out what RC is being prepared.