release.sh | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
New commits:
commit 98ca56a314b1b8a1d7e00b4aa7ccad01da6cf750
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Nov 16 09:21:46 2012 -0600
Add option to override the tag name generated by the script. This feature should be used for continuous integration purposes only.
(cherry picked from commit 310e27df47e9c46c8d272139af6c326645975d02)
diff --git a/release.sh b/release.sh
index f9c816d..7d6a16e 100755
--- a/release.sh
+++ b/release.sh
@@ -63,7 +63,10 @@ USAGE: release.sh OPTIONS
Set maven in debug mode. Default is false; true if option specified without argument.
--workspace=workspace_to_use [OPTIONAL]
- Override the workspace used by default by the script.
+ Override the workspace used by the script.
+
+ --tag-name=tag_name [OPTIONAL]
+ Override the default tag name generated by this script. Using the default tag name is the preferred alternative. Please use this option only if absolutely needed.
--override-tag=[true|false] [OPTIONAL]
Override the tag if it already exists remotely. Default is false; true if option specified without argument.
@@ -94,9 +97,10 @@ parse_and_validate_options()
DEBUG_MODE=false
OVERRIDE_TAG=false
TERMINAL_BRANCH=false
+ RELEASE_TAG=
short_options="h"
- long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug::,workspace:,override-tag::"
+ long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug::,workspace:,override-tag::,tag-name:"
PROGNAME=${0##*/}
ARGS=$(getopt -s bash --options $short_options --longoptions $long_options --name $PROGNAME -- "$@" )
@@ -184,6 +188,11 @@ parse_and_validate_options()
WORKSPACE=$1
shift
;;
+ --tag-name)
+ shift
+ RELEASE_TAG=$1
+ shift
+ ;;
--override-tag)
shift
case "$1" in
@@ -297,9 +306,11 @@ set_local_and_environment_variables()
MAVEN_ARGS="$MAVEN_ARGS --debug"
fi
- TAG_PREFIX="RHQ"
- TAG_VERSION=`echo $RELEASE_VERSION | sed 's/[\.|-]/_/g'`
- RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
+ if [ -z "RELEASE_TAG" ]; then
+ TAG_PREFIX="RHQ"
+ TAG_VERSION=`echo $RELEASE_VERSION | sed 's/[\.|-]/_/g'`
+ RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
+ fi
# Set the system character encoding to ISO-8859-1 to ensure i18log reads its
# messages and writes its resource bundle properties files in that encoding,
@@ -571,7 +582,6 @@ checkout_build_branch_for_release()
BUILD_BRANCH="${RELEASE_BRANCH}"
else
BUILD_BRANCH="release-$RELEASE_VERSION"
- # delete the branch if it exists, so we can recreate it fresh
EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"`
if [ -n "$EXISTING_BUILD_BRANCH" ];
then