Permalink
Browse files

Add release script

  • Loading branch information...
1 parent 775a6c1 commit c07d2dd876f6df1e64cdfd44f58be1cf607ba397 @pmuir pmuir committed May 25, 2012
Showing with 103 additions and 0 deletions.
  1. +103 −0 release.sh
View
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+# Require BASH 3 or newer
+
+REQUIRED_BASH_VERSION=3.0.0
+
+if [[ $BASH_VERSION < $REQUIRED_BASH_VERSION ]]; then
+ echo "You must use Bash version 3 or newer to run this script"
+ exit
+fi
+
+# Canonicalise the source dir, allow this script to be called anywhere
+DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
+
+# DEFINE
+
+# EAP team email subject
+EAP_SUBJECT="\${RELEASEVERSION} of JBoss AS Archetypes released, please add to EAP maven repo build"
+# EAP team email To ?
+EAP_EMAIL_TO="pgier@redhat.com kpwiko@redhat.com"
+
+
+
+# SCRIPT
+
+usage()
+{
+cat << EOF
+usage: $0 options
+
+This script performs a release of the JBoss AS Archetypes
+
+OPTIONS:
+ -s Snapshot version number to update from
+ -n New snapshot version number to update to, if undefined, defaults to the version number updated from
+ -r Release version number
+EOF
+}
+
+notify()
+{
+ echo "***** Performing JBoss AS Archetypes release notifications"
+ echo "*** Notifying JBoss EAP team"
+ # send email using /bin/mail
+ subject = eval $EAP_SUBJECT
+ echo "See \$subject :-)" | /usr/bin/env mail -s "$subject" "$EAP_EMAIL_TO"
+
+}
+
+release()
+{
+ echo "Releasing JBoss Archetypes version $RELEASEVERSION"
+ $DIR/release-utils.sh -u -o $SNAPSHOTVERSION -n $RELEASEVERSION
+ git commit -a -m "Prepare for $RELEASEVERSION release"
+ git tag -a $RELEASEVERSION -m "Tag $RELEASEVERSION"
+ $DIR/release-utils.sh -r
+ $DIR/release-utils.sh -u -o $RELEASEVERSION -n $NEWSNAPSHOTVERSION
+ git commit -a -m "Prepare for development of $NEWSNAPSHOTVERSION"
+ echo "***** JBoss Archetypes released"
+}
+
+SNAPSHOTVERSION="UNDEFINED"
+RELEASEVERSION="UNDEFINED"
+NEWSNAPSHOTVERSION="UNDEFINED"
+
+while getopts “n:r:s:” OPTION
+
+do
+ case $OPTION in
+ h)
+ usage
+ exit
+ ;;
+ s)
+ SNAPSHOTVERSION=$OPTARG
+ ;;
+ r)
+ RELEASEVERSION=$OPTARG
+ ;;
+ n)
+ NEWSNAPSHOTVERSION=$OPTARG
+ ;;
+ [?])
+ usage
+ exit
+ ;;
+ esac
+done
+
+if [ "$NEWSNAPSHOTVERSION" == "UNDEFINED" ]
+then
+ NEWSNAPSHOTVERSION=$SNAPSHOTVERSION
+fi
+
+if [ "$SNAPSHOTVERSION" == "UNDEFINED" -o "$RELEASEVERSION" == "UNDEFINED" ]
+then
+ echo "\nMust specify -r and -s\n"
+ usage
+else
+ release
+fi
+
+

0 comments on commit c07d2dd

Please sign in to comment.