Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improved release script
  • Loading branch information
m2spring committed Sep 21, 2012
1 parent 4d76796 commit 3bc81ca
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
24 changes: 24 additions & 0 deletions jenkow-plugin/pom.xml
Expand Up @@ -278,6 +278,30 @@ THE SOFTWARE.
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
56 changes: 56 additions & 0 deletions release.sh
@@ -0,0 +1,56 @@
#!/bin/bash

export PRJ=$(cd `dirname $0`; pwd)

if [ $# != 2 ]; then
echo "usage: release.sh <release-version> <next-trunk-version>"
exit 1
fi

RELVER=$1; shift
NEXTVER=$1; shift

export HOME="$WORKSPACE"

x=${GIT:=git}

x=${MAVEN_HOME:=/auto/surf-tp/configs/surf/tools/apache-maven-3.0.3}
export MAVEN_HOME

x=${JAVA_HOME:=/auto/java/jdks/lnx/jdk1.6.0_latest}
export JAVA_HOME

x=${MAVEN_OPTS:=-Xmx4000m -Xms1024m -XX:MaxPermSize=128m}
export MAVEN_OPTS

x=${MVN_OPTIONS:=-e -B --fail-at-end --update-snapshots}
x=${MVN_GOAL:=install}

umask 0022

export MVN="$MAVEN_HOME/bin/mvn"
MVN_REPO="$PRJ/.repository"
mkdir -p "$MVN_REPO"
rm -rf "$MVN_REPO/com/cisco" "$MVN_REPO/org/activiti"
MVN="$MVN -D=maven.repo.local=$MVN_REPO"

cd $PRJ

set -e
set -x

$GIT checkout -f -b v$RELVER
./update-versions.sh $RELVER
$GIT commit -am "created release $RELVER"
$MVN $MVN_OPTIONS clean install || exit 1

$GIT checkout -f master
./update-versions.sh $NEXTVER-SNAPSHOT
$GIT commit -am "new trunk $NEXTVER"
$MVN $MVN_OPTIONS clean install -Dmaven.test.skip=true || exit 1

$GIT checkout -f v$RELVER
$MVN $MVN_OPTIONS -f jenkow-plugin deploy -Dmaven.test.skip=true || exit 1
$GIT checkout -f master

$GIT push --all
5 changes: 5 additions & 0 deletions update-versions.sh
Expand Up @@ -41,6 +41,11 @@ case $NEW_VERSION in
esac

x=${XML:=/usr/cisco/bin/xml}
if [ ! -x $XML ]; then
echo "unable to find XML tool under $XML"
exit 1
fi

TS=`date +%Y%m%d-%H%M%S`

function updateAnyVersion ()
Expand Down

0 comments on commit 3bc81ca

Please sign in to comment.