Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
none
none
titlemkopenjparelease.sh
borderStylesolid
#!/bin/sh -pve
# Author: Marc Prud'hommeaux <mprudhom@apache.org>
# Performs the release steps described at:
#
#   http://cwiki.apache.org/openjpa/releasing-openjpa.html
# 
# It will do the following:
#
# 1. Check out a fresh version of openjpa from the branch
# 2. Update the openjpa pom.xml files to have the new version
# 3. Commit the pom.xml changes
# 4. Make the release files
# 5. Verify the signature
# 6. Test the examples in the release
# 7. Perform the deploy
# 8. Tag the view using "svn copy"

BASEDIR=/tmp/openjpa-staging/
RELEASEDIR=${BASEDIR}/openjpa
EXAMPLESDIR=${BASEDIR}/examples

rm -rf ${BASEDIR} || echo Staging directory already deleted

# OLDVERSION=0.9.6-incubating-SNAPSHOT
# RELEASEVERSION=0.9.6-incubating

OLDVERSION=${1}
RELEASEVERSION=${2}

shift;
shift;
EXTRAARGS=${@}

# example usage:
# openjpa.mkrelease 0.9.6-incubating-SNAPSHOT 0.9.6-incubating 0.9.7-incubating-SNAPSHOT
# openjpa.mkrelease 0.9.6-incubating-SNAPSHOT 0.9.6-incubating 0.9.7-incubating-SNAPSHOT \
# -Dopenjpa.release.keyAlias=somegpgkeyalias@somedomain.org

test ! -z ${RELEASEVERSION} || echo "Usage: ${0} OLDVERSION RELEASEVERSION"
test ! -z ${RELEASEVERSION}

# svn co https://svn.apache.org/repos/asf/incubator/openjpa/trunk/ ${RELEASEDIR}

# Check out from the branch (note that a branch with the same name 
# as the release version needs to exist)...
SVNBASE="https://svn.apache.org/repos/asf/incubator/openjpa"
TRUNK="${SVNBASE}/trunk"
BRANCH="${SVNBASE}/branches/${RELEASEVERSION}"
TAG="${SVNBASE}/tags/${RELEASEVERSION}"

svn co ${BRANCH} ${RELEASEDIR} || 
  \ (echo "$0: Branch does not exist. You can create it \
     from the trunk with: svn copy ${TRUNK} ${BRANCH}" && false)

cd ${RELEASEDIR}
 
grep "<version>${OLDVERSION}</version>" pom.xml || \
  echo "ERROR: version is not the expected version (${OLDVERSION})"
grep "<version>${OLDVERSION}</version>" pom.xml

perl -pi -e "s;<version>${OLDVERSION}</version>;<version>${RELEASEVERSION}</version>;g" pom.xml */pom.xml 

svn commit -m "Updated to version ${RELEASEVERSION}" 

# Pre-build: need to do this to get around bugs in aggregate javadocs, as
# well as making a signature we can test
mvn clean install -Pdocbook-profile,sign-release "${EXTRAARGS}"

# Verify the signatures
gpg --multifile --verify openjpa-project/target/assembly/*.asc

# Test the examples to make sure they work
OLDDIR=`pwd`
rm -rf ${EXAMPLESDIR} || true
mkdir -p ${EXAMPLESDIR}
cd ${EXAMPLESDIR}
unzip ${RELEASEDIR}/openjpa-project/target/assembly/*-binary.zip

for build in openjpa-*/examples/*/build.xml
    do
    ant -f ${build}
done

cd ${OLDDIR}

# Now actually build the javadocs and perform the deploy upload
mvn verify deploy -Pjavadoc-profile,sign-release "${EXTRAARGS}"

# Remove any identical tag
svn delete -m "Removed old ${RELEASEVERSION} tag for re-tagging" ${TAG} || \
  echo "Tag does not already exist, so does not need to be removed"

# Now tag the view
svn copy -m "OpenJPA Release ${RELEASEVERSION}" ${BRANCH} ${TAG}

# We don't do this anymore since we release from branches, not from trunk
# Update to the next version
# perl -pi -e "s;<version>${RELEASEVERSION}</version>;<version>${NEXTVERSION}</version>;g" pom.xml */pom.xml 
# 
# # Commit the next versions
# svn commit -m "Updated to version ${NEXTVERSION}" 

...