MNEMONIC-253: Fix prompt information for release.sh
diff --git a/build-tools/release.sh b/build-tools/release.sh
index 116497c..07c3984 100755
--- a/build-tools/release.sh
+++ b/build-tools/release.sh
@@ -48,7 +48,7 @@
RELEASE_VERSION="$1"
NEXT_RELEASE_VERSION="$2"
RELEASE_CANDIDATE_ID="$3"
-NEXT_VER_COMMIT_PREFIX="Bump version"
+IS_SAME_VERSION=false
echo "You have specified:"
echo "RELEASE_VERSION = ${RELEASE_VERSION}"
@@ -60,7 +60,8 @@
git checkout master
if [ "${RELEASE_VERSION}" == "${NEXT_RELEASE_VERSION}" ]; then
- echo "You are trying to prepare a same version candidate so going to clean up existing branch <branch-${RELEASE_VERSION}> and tag <v${RELEASE_VERSION}-incubating> if any"
+ IS_SAME_VERSION=true
+ echo "You are trying to prepare a same version candidate so going to clean up existing branch <branch-${RELEASE_VERSION}> and tag <v${RELEASE_VERSION}-incubating> if exists"
continueprompt
git branch -d branch-${RELEASE_VERSION}
if [ $? -ne 0 ]; then
@@ -71,7 +72,6 @@
git push upstream --delete branch-${RELEASE_VERSION}
git tag -d v${RELEASE_VERSION}-incubating
git push upstream --delete v${RELEASE_VERSION}-incubating
- NEXT_VER_COMMIT_PREFIX="Stay version"
fi
echo "Preparing to create a branch branch-${RELEASE_VERSION} for release"
@@ -82,7 +82,7 @@
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${RELEASE_VERSION}-incubating
git commit . -m "Prepare for releasing ${RELEASE_VERSION}-incubating ${RELEASE_CANDIDATE_ID}"
-git tag -s v${RELEASE_VERSION}-incubating -m "Releasing ${RELEASE_VERSION}-incubating ${RELEASE_CANDIDATE_ID}"
+git tag -s v${RELEASE_VERSION}-incubating -m "Release ${RELEASE_VERSION}-incubating ${RELEASE_CANDIDATE_ID}"
rm -rf target/
git clean -xdf
@@ -129,8 +129,16 @@
git checkout master
git merge --no-ff branch-${RELEASE_VERSION}
-mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${NEXT_RELEASE_VERSION}-incubating-SNAPSHOT
-git commit . -m "${NEXT_VER_COMMIT_PREFIX} to ${NEXT_RELEASE_VERSION}-incubating-SNAPSHOT"
+
+if [ "$IS_SAME_VERSION" = true ]; then
+ NEXT_RELEASE_VERSION_POM="${RELEASE_VERSION}-incubating-SNAPSHOT"
+ NEXT_RELEASE_VERSION_COMMIT="Version ${RELEASE_VERSION}-incubating ${RELEASE_CANDIDATE_ID}"
+else
+ NEXT_RELEASE_VERSION_POM="${NEXT_RELEASE_VERSION}-incubating-SNAPSHOT"
+ NEXT_RELEASE_VERSION_COMMIT="Bump version to ${NEXT_RELEASE_VERSION}-incubating-SNAPSHOT"
+fi
+mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${NEXT_RELEASE_VERSION_POM}"
+git commit . -m "${NEXT_RELEASE_VERSION_COMMIT}"
echo "Push release merge and new version to upstream."
continueprompt