release.sh | 48 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 37 insertions(+), 11 deletions(-)
New commits:
commit e580d02c3197edfd070555ba397b24bf9698caa3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Sep 29 17:45:10 2011 -0500
Small updates to get the script ready for live test runs.
diff --git a/release.sh b/release.sh
index b5f188d..e0fb98a 100755
--- a/release.sh
+++ b/release.sh
@@ -125,7 +125,6 @@ set_variables()
MAVEN_RELEASE_PERFORM_GOAL="install"
#fi
-
TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
@@ -143,7 +142,7 @@ set_variables()
# Description: Perform version update process and test the outcome by building
# from source.
#===================================================================================
-run_versioning_process()
+run_tag_version_process()
{
# 1) Cleanup before doing anything
echo "Cleaning up module target dirs"
@@ -179,10 +178,10 @@ run_versioning_process()
# 8) Commit the change in version (if everything went well so far then this is a good
tag
git add -u
- git commit -m "tag RHQ_$RELEASE_VERSION"
+ git commit -m "tag $RELEASE_TAG"
# 9) Tag the current source
- git tag "RHQ_$RELEASE_VERSION"
+ git tag "$RELEASE_TAG"
# 10) Set version to the current development version
mvn versions:set versions:use-releases -DnewVersion=$DEVELOPMENT_VERSION
-DallowSnapshots=false -DgenerateBackupPoms=false
@@ -235,8 +234,6 @@ print_program_versions "${program_versions[@]}"
print_centered "="
-exit
-
# Checkout the source from git, assume that the git repo is already cloned
git status >/dev/null 2>&1
GIT_STATUS_EXIT_CODE=$?
@@ -298,7 +295,7 @@ if [ -n "$EXISTING_LOCAL_TAG" ]; then
abort "A local tag named $RELEASE_TAG already exists - aborting"
fi
-run_versioning_process
+run_tag_version_process
echo
echo "=============================== Release Info
=================================="
commit fe98b3b2febad8804ca5a04380bb86dc99e21f20
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Sep 29 17:14:41 2011 -0500
Added rough tagging and versioning algorithm for cases when tagging is the only
operation to be performed.
diff --git a/release.sh b/release.sh
index 629e30f..b5f188d 100755
--- a/release.sh
+++ b/release.sh
@@ -145,26 +145,55 @@ set_variables()
#===================================================================================
run_versioning_process()
{
- # Clean up the snapshot jars produced by the test build from module target dirs.
- echo "Cleaning up snapshot jars produced by test build from module target
dirs..."
+ # 1) Cleanup before doing anything
+ echo "Cleaning up module target dirs"
mvn clean $MAVEN_ARGS
- [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars
produced by test build from module target dirs. Please see above Maven output for details,
fix any issues, then try again."
+ [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars from
module target dirs. Please see above Maven output for details, fix any issues, then try
again."
+ # 2) Perform a test build before changing version
mvn install $MAVEN_ARGS -Ddbreset
[ "$?" -ne 0 ] && abort "Test build failed. Please see output
for details, fix any issues, then try again."
+ # 3) Run another cleanup
+ echo "Cleaning up module target dirs..."
+ mvn clean $MAVEN_ARGS
+ [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars
produced by test build from module target dirs. Please see above Maven output for details,
fix any issues, then try again."
+
+ # 4) Increment version on all poms
mvn versions:set versions:use-releases -DnewVersion=$RELEASE_VERSION
-DallowSnapshots=false -DgenerateBackupPoms=false
[ "$?" -ne 0 ] && abort "Version set failed. Please see output
for details, fix any issues, then try again."
+ # 5) Perform a test build with the new version
mvn install $MAVEN_ARGS -DskipTests=true -Ddbsetup-do-not-check-schema=true
[ "$?" -ne 0 ] && abort "Maven build for new version failed.
Please see output for details, fix any issues, then try again."
- mvn versions:set versions:use-releases -DnewVersion=$DEVELOPMENT_VERSION
-DallowSnapshots=false -DgenerateBackupPoms=false
- [ "$?" -ne 0 ] && abort "Version set failed. Please see output
for details, fix any issues, then try again."
-
+ # 6) Publish release artifacts
#echo "Building release from tag and publishing Maven artifacts (this will take
about 10-15 minutes)..."
#mvn $MAVEN_RELEASE_PERFORM_GOAL $MAVEN_ARGS -Dmaven.test.skip=true
-Ddbsetup-do-not-check-schema=true
#[ "$?" -ne 0 ] && abort "Release build failed. Please see
above Maven output for details, fix any issues, then try again."
+
+ # 7) Cleanup after this test build
+ echo "Cleaning up module target dirs..."
+ mvn clean $MAVEN_ARGS
+ [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars
produced by test build from module target dirs. Please see above Maven output for details,
fix any issues, then try again."
+
+ # 8) Commit the change in version (if everything went well so far then this is a good
tag
+ git add -u
+ git commit -m "tag RHQ_$RELEASE_VERSION"
+
+ # 9) Tag the current source
+ git tag "RHQ_$RELEASE_VERSION"
+
+ # 10) Set version to the current development version
+ mvn versions:set versions:use-releases -DnewVersion=$DEVELOPMENT_VERSION
-DallowSnapshots=false -DgenerateBackupPoms=false
+ [ "$?" -ne 0 ] && abort "Version set failed. Please see output
for details, fix any issues, then try again."
+
+ # 11) Commit the change in version (if everything went well so far then this is a good
tag
+ git add -u
+ git commit -m "development RHQ_$DEVELOPMENT_VERSION"
+
+ # 12) If everything went well so far than means all the changes can be pushed!!!
+ git push origin $RELEASE_BRANCH
}
if [ -n "$RELEASE_DEBUG" ]; then
Show replies by date