rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject svn commit: r1176960 - /incubator/rave/release-management/release.sh
Date Wed, 28 Sep 2011 17:02:46 GMT
Author: mfranklin
Date: Wed Sep 28 17:02:46 2011
New Revision: 1176960

URL: http://svn.apache.org/viewvc?rev=1176960&view=rev
Log:
Updated release script

Modified:
    incubator/rave/release-management/release.sh

Modified: incubator/rave/release-management/release.sh
URL: http://svn.apache.org/viewvc/incubator/rave/release-management/release.sh?rev=1176960&r1=1176959&r2=1176960&view=diff
==============================================================================
--- incubator/rave/release-management/release.sh (original)
+++ incubator/rave/release-management/release.sh Wed Sep 28 17:02:46 2011
@@ -1,27 +1,123 @@
 #!/bin/bash
 
 MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
-SVN_TRUNK=http://svn.apache.org/repos/asf/incubator/rave/trunk
 RELEASE_VERSION=$1
+SVN_ROOT=http://svn.apache.org/repos/asf/incubator/rave
+SVN_TRUNK=$SVN_ROOT/trunk
+SVN_TAG=$SVN_ROOT/tags/$RELEASE_VERSION-incubating
 
+_continueOrExit() {
+   RETURN=$1
+   if ["$RETURN" != "0"];
+     then
+       echo "Terminating release process due to prior error"
+       exit $RETURN
+   fi
+}
 
-cd /tmp
-svn co $SVN_TRUNK ./rave-$RELEASE_VERSION
-cd rave-$RELEASE_VERSION
-mvn -DskipTests -P pedantic verify 
-mvn -DdryRun=true -P apache-release release:prepare
-mvn -P apache-release release:rollback
-mvn -P apache-release release:prepare
-mvn -P apache-release release:perform
-
-mvn -P dist
-cd ./rave-portal/target/
-gpg -ab rave-${RELEASE_VERSION}-incubating-bin.zip
-gpg -ab rave-${RELEASE_VERSION}-incubating-bin.tar.gz
-gpg --print-md SHA512 rave-${RELEASE_VERSION}-incubating-bin.zip > rave-${RELEASE_VERSION}-incubating-bin.zip.sha
-gpg --print-md SHA512 rave-${RELEASE_VERSION}-incubating-bin.tar.gz > rave-${RELEASE_VERSION}-incubating-bin.zip.sha
-gpg --print-md MD5 rave-${RELEASE_VERSION}-incubating-bin.zip > rave-${RELEASE_VERSION}-incubating-bin.zip.md5
-gpg --print-md MD5 rave-${RELEASE_VERSION}-incubating-bin.tar.gz > rave-${RELEASE_VERSION}-incubating-bin.zip.md5
+_promptUser() {
+   PROMPT=$1
+   echo $PROMPT
+   read RESPONSE
+   case $RESPONSE in
+     
+     y)
+	echo "Continuing release process"
+        ;;
 
-ssh people.apache.org mkdir /www/people.apache.org/builds/incubator/rave/${RELEASE_VERSION}-incubating
-scp rave-${RELEASE_VERSION}-incubating.bin.* people.apache.org:/www/people.apache.org/builds/incubator/rave/${RELEASE_VERSION}-incubating/
+     n)
+	echo "Terminating release process due to user action"
+	exit 1
+	;;
+     *)
+        echo "Invalid response.  Please enter one of the following: y/n"
+        _promptUser $PROMPT 
+	;;
+   esac
+
+}
+
+_doCheckout() {
+   svn co $1 ./rave-co
+   _continueOrExit $?
+   cd rave-co
+}
+
+_doDryRun() {
+   mvn -DskipTests -P pedantic verify
+   _continueOrExit $? 
+
+   mvn -DdryRun=true -P apache-release release:prepare
+   _continueOrExit $?
+
+   DIR=`pwd`
+   promptUser "Verify the POMs & release files in $DIR.  Are they acceptable (y/n)"
+}
+
+_doRelease() {
+
+   mvn -P apache-release release:rollback
+   _continueOrExit $?
+   
+   mvn -P apache-release release:prepare
+   _continueOrExit $?
+   
+   mvn -P apache-release release:perform
+   _continueOrExit $?
+   
+   cd ..
+   rm -rfv rave-co
+}
+
+_doDistRelease() {
+   mvn -P dist
+   _continueOrExit $?
+ 
+   cd ./rave-portal/target/
+   gpg -ab rave-$RELEASE_VERSION-incubating-bin.zip
+   _continueOrExit $?
+   
+   gpg -ab rave-$RELEASE_VERSION-incubating-bin.tar.gz
+   _continueOrExit $?
+
+   gpg --print-md SHA512 rave-$RELEASE_VERSION-incubating-bin.zip > rave-$RELEASE_VERSION-incubating-bin.zip.sha
+   _continueOrExit $?
+
+   gpg --print-md SHA512 rave-$RELEASE_VERSION-incubating-bin.tar.gz > rave-$RELEASE_VERSION-incubating-bin.zip.sha
+   _continueOrExit $?
+ 
+   gpg --print-md MD5 rave-$RELEASE_VERSION-incubating-bin.zip > rave-$RELEASE_VERSION-incubating-bin.zip.md5
+   _continueOrExit $?
+
+   gpg --print-md MD5 rave-$RELEASE_VERSION-incubating-bin.tar.gz > rave-$RELEASE_VERSION-incubating-bin.zip.md5
+   _continueOrExit $?
+
+   ssh people.apache.org mkdir /www/people.apache.org/builds/incubator/rave/$RELEASE_VERSION-incubating
+   _continueOrExit $?
+
+   scp rave-$RELEASE_VERSION-incubating.bin.* people.apache.org:/www/people.apache.org/builds/incubator/rave/$RELEASE_VERSION-incubating/
+   _continueOrExit $?
+}
+
+_verifySignatures() {
+  for file in `find . -type f -iname '*.asc'`
+  do
+      gpg --verify ${file} 
+      _continueOrExit $?
+  done
+}
+
+
+if  [ "$RELEASE_VERSION" == "" ];
+   echo "You must provide a valid release version.  IE 0.6"
+   exit 1   
+fi 
+
+_doCheckout $SVN_TRUNK
+_doDryRun
+_verifySignatures
+_doRelease
+_doCheckout $SVN_TAG
+_doDistRelease
+
+echo "Release complete.  Don't forget to check & close the staging repositories"



Mime
View raw message