2007-09-02 14:14:02 -04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# This script must be run from the project root directory
|
2007-09-03 21:12:31 -04:00
|
|
|
#
|
|
|
|
# Release Process.
|
|
|
|
#
|
|
|
|
# 1. Do clean check out of source from svn.
|
|
|
|
# 2. Set the version number in the pom.xml files of all the module
|
|
|
|
# 3. Set the correct spring version number in the pom.xml.
|
|
|
|
# 3a Set the same version number in this script
|
|
|
|
# 4. Commit the source with the changed version numbers and note the revision number.
|
|
|
|
# 5. Run this script to generate the artifacts and web site in the 'release' directory.
|
|
|
|
#
|
|
|
|
#
|
2007-09-02 14:14:02 -04:00
|
|
|
|
2007-09-03 21:12:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
#
|
2007-09-02 14:14:02 -04:00
|
|
|
# Edit this release number before running. It is used to check jar names etc.
|
2007-09-03 21:12:31 -04:00
|
|
|
#
|
2007-09-02 14:14:02 -04:00
|
|
|
RELEASE_VERSION=1.0.5-SNAPSHOT
|
|
|
|
|
|
|
|
PROJ_DIR=`pwd`;
|
|
|
|
RELEASE_DIR=$PROJ_DIR/release
|
|
|
|
SITE_DIR=$RELEASE_DIR/site
|
|
|
|
|
|
|
|
echo "** Project directory is $PROJ_DIR"
|
|
|
|
|
|
|
|
SVN_REV=`svn info $PROJ_DIR | grep Revision | sed "s/Revision: //"`
|
|
|
|
|
|
|
|
echo "** Building from revision $SVN_REV"
|
|
|
|
|
2007-09-03 21:12:31 -04:00
|
|
|
#
|
|
|
|
# Check the sandbox builds with the current configuration
|
|
|
|
#
|
|
|
|
|
|
|
|
pushd sandbox
|
|
|
|
|
|
|
|
mvn clean test
|
|
|
|
|
|
|
|
if [ "$?" -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "Failed to build sandbox with current configuration."
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create the release directory if it doesn't already exist
|
|
|
|
#
|
2007-09-02 14:14:02 -04:00
|
|
|
|
|
|
|
if [[ -e $RELEASE_DIR ]]
|
|
|
|
then
|
|
|
|
rm -Rf $RELEASE_DIR
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir $RELEASE_DIR
|
|
|
|
mkdir $SITE_DIR
|
|
|
|
|
|
|
|
# run maven to generate jars
|
|
|
|
|
|
|
|
mvn clean install -DcreateChecksum=true
|
|
|
|
|
|
|
|
if [ "$?" -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "mvn install failed"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "** Generating site in $SITE_DIR".
|
|
|
|
|
|
|
|
mvn site docbkx:generate-html docbkx:generate-pdf site:deploy -DsiteDirectory=file://${SITE_DIR}
|
|
|
|
|
|
|
|
if [ "$?" -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "mvn site generation failed"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2007-09-03 21:12:31 -04:00
|
|
|
# Patch the module site files to point to the root css files, change names of oversized menus,
|
|
|
|
# remove dodgy standard maven text etc.
|
|
|
|
#
|
2007-09-03 05:55:08 -04:00
|
|
|
|
|
|
|
pushd $RELEASE_DIR/site
|
|
|
|
|
2007-09-03 21:12:31 -04:00
|
|
|
find . -name "*.html" -maxdepth 2 -mindepth 2 | xargs perl -i -p -e 's#\./css/#\.\./css/#;' \
|
|
|
|
-e 's/Maven Surefire Report/Unit Tests/;' \
|
2007-09-04 11:14:54 -04:00
|
|
|
-e 's/Cobertura Test Coverage/Test Coverage/;' \
|
2007-09-03 21:12:31 -04:00
|
|
|
-e 's/A successful project.*greatly appreciated\.//;'
|
2007-09-03 05:55:08 -04:00
|
|
|
|
|
|
|
|
2007-09-03 21:12:31 -04:00
|
|
|
popd
|
2007-09-03 05:55:08 -04:00
|
|
|
|
2007-09-02 14:14:02 -04:00
|
|
|
|
|
|
|
# Assemble the required jar files
|
|
|
|
|
2007-09-04 11:14:54 -04:00
|
|
|
find . -name "*${RELEASE_VERSION}.jar" | grep -v WEB-INF | xargs -I % -n 1 cp % $RELEASE_DIR
|
|
|
|
find . -name "*${RELEASE_VERSION}.war" | xargs -I % -n 1 cp % $RELEASE_DIR
|
2007-09-02 14:14:02 -04:00
|
|
|
|
|
|
|
# Should be 9 archives - core, core-tiger, the adapters (cas, jboss, resin, jetty, catalina), tutorial and contacts wars.
|
|
|
|
|
|
|
|
pushd $RELEASE_DIR
|
|
|
|
|
|
|
|
NUM_JARS=`ls *.jar *.war | wc -l`
|
|
|
|
|
|
|
|
if [ "$NUM_JARS" -ne 9 ]
|
|
|
|
then
|
|
|
|
echo "Expected 9 Jar files but found $NUM_JARS."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Create the signatures
|
|
|
|
|
|
|
|
for jar in $(ls *.jar *.war); do
|
|
|
|
openssl sha1 < $jar > $jar.sha1
|
|
|
|
openssl md5 < $jar > $jar.md5
|
|
|
|
done
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|