You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by da...@apache.org on 2006/09/22 04:49:50 UTC

svn commit: r448776 - /geronimo/gbuild/scripts/publish_build.sh

Author: dain
Date: Thu Sep 21 19:49:50 2006
New Revision: 448776

URL: http://svn.apache.org/viewvc?view=rev&rev=448776
Log:
Updated for Geronimo 1.2 and Maven 2 
Publishing to apache works but it currently disabled
Version number update doesn't work

Modified:
    geronimo/gbuild/scripts/publish_build.sh

Modified: geronimo/gbuild/scripts/publish_build.sh
URL: http://svn.apache.org/viewvc/geronimo/gbuild/scripts/publish_build.sh?view=diff&rev=448776&r1=448775&r2=448776
==============================================================================
--- geronimo/gbuild/scripts/publish_build.sh (original)
+++ geronimo/gbuild/scripts/publish_build.sh Thu Sep 21 19:49:50 2006
@@ -18,6 +18,24 @@
 # $Rev$ $Date$
 # --------------------------------------------------------------------
 
+### Utility functions ########
+function shash { openssl $1 < $2 > $2.$1 ;}
+function fail () { echo $1 >&2; exit 1;}
+function required_software () { [ -x "$(which $1)" ] || MISSING_SOFTWARE="$MISSING_SOFTWARE $1"; }
+
+# Required software
+required_software wget
+required_software svn
+required_software scp
+required_software openssl
+required_software perl
+required_software sed
+required_software grep
+required_software zip
+required_software tar
+required_software mvn
+[ -n "$MISSING_SOFTWARE" ] && fail "The following required software is not installed: $MISSING_SOFTWARE"
+
 #  If we need to SSH up to the server where the builds are published
 #  These three varaibles will be used to find the host 
 REMOTE_HOST=${1:-apache.org}
@@ -28,7 +46,7 @@
 #  It's fine as we really don't even need to run this script nightly and
 #  can instead opt to run it just when we think we think things are in a 
 #  relatively good state.
-RELEASE_DIR=${2:-/www/cvs.apache.org/dist/geronimo/unstable}
+RELEASE_DIR=${2:-/www/people.apache.org/dist/geronimo/unstable}
 
 PROJ=geronimo
 BIN_DIR=modules/assembly/target
@@ -40,14 +58,15 @@
 
 #  The public repo url for geronimo
 SVN_URL="http://svn.apache.org/repos/asf/$PROJ"
+SVN_PATH="server/trunk"
 
 #  Get the current svn revision number for geronimo
 #  Example: 123456
-export SVN_VERSION=$(wget -q -O - $SVN_URL/trunk | grep title | sed 's/[^0-9]//g')
+export SVN_VERSION=$(wget -q -O - $SVN_URL/$SVN_PATH | grep title | sed 's/[^0-9]//g')
 
 #  The version of geronimo we are building.  In the future we may have nightly builds
 #  of 1.0 and 2.0 going at the same time, so it's nice to include that in the build name
-VN='1.1'
+VN='1.2'
 
 #  Example value: 1.0-123456
 VERSION="$VN-$SVN_VERSION"
@@ -60,22 +79,16 @@
 
 echo "$RELEASE_ID"
 
-rm -r ~/.maven/cache
-rm -r ~/.maven/repository/geronimo/plugins
-rm -r ~/.maven/plugins
-    
-### Utility functions ########
-function shash { openssl $1 < $2 > $2.$1 ;}
-function fail () { echo $1 >&2; exit 1;}
+### Build functions ########
 function package () { 
     DEST=$1; SOURCE=$2
     tar czf $DEST.tar.gz $SOURCE
     zip -9rq $DEST.zip $SOURCE
 }
 function replace_version {
-	perl -i.orig -pe 's,(-SNAPSHOT)?$,-$ENV{SVN_VERSION}, if /^(geronimo.packaging.)?geronimo_?(.*?plugin_)?[Vv]ersion=/' etc/project.properties  plugins/*/*.properties
+        perl -i.orig -pe 's,(-SNAPSHOT)?$,-$ENV{SVN_VERSION}, if /^(geronimo.packaging.)?geronimo_?(.*?plugin_)?[Vv]ersion=/' etc/project.properties  plugins/*/*.properties
 
-	perl -i.orig -pe '
+        perl -i.orig -pe '
 s,(</currentVersion>),-$ENV{SVN_VERSION}$1, unless /SNAPSHOT/;
 s,-SNAPSHOT(</currentVersion>),-$ENV{SVN_VERSION}$1,;
 s,-SNAPSHOT(</(dep:)?version>),-$ENV{SVN_VERSION}$1, if $p2 =~ /<(dep:)?groupId>geronimo/; 
@@ -84,42 +97,55 @@
 
         #perl -i.orig -pe 's,SNAPSHOT,GERONIMO, if $p2 =~ /<groupId>geronimo/;$p2=$p1;$p1=$_' plugins/geronimo-packaging-plugin/src/test-resources/plan.xml
 
-	perl -i.orig -pe 's,(-SNAPSHOT)?$,-$ENV{SVN_VERSION}, if /^geronimo...=/' etc/explicit_versions.properties
+        perl -i.orig -pe 's,(-SNAPSHOT)?$,-$ENV{SVN_VERSION}, if /^geronimo...=/' etc/explicit_versions.properties
 
 }
-function publish_build_archives {
+
+function checkout_source {
 
     #  We want to checkout Geronimo into a directory that will be named
     #  just right to be the source directory, then we can just zip and tar
     #  it up before we build it.
     #
     #  The directory will be named geronimo-1.0-SVN_REVISION_NUMBER
-    svn export --revision $SVN_VERSION $SVN_URL/branches/1.1 $RELEASE_ID
-    
-    ( cd $RELEASE_ID && replace_version )
+    svn export --revision $SVN_VERSION $SVN_URL/$SVN_PATH $RELEASE_ID || fail "svn export failed"
+ 
+    # Replace the version number in the poms with our svn version number
+#    ( cd $RELEASE_ID && replace_version )
 
     #  Now let's create the source zip and tar before we build while we
     #  still have a completely clean checkout with no target directories,
     #  velocity.log files and other junk created during a build.
     package $DIST/${RELEASE_ID}-src $RELEASE_ID || fail "Unable to create source binaries"
+}
 
+function build_archives {
     #  Let's go ahead and run the build to create the geronimo-foo-1.0-SVN_REVISION.jar files
     #  We don't run the tests as this is not a script for testing and reporting those test results.
     #  If the build fails to compile, the 'fail' function is called and this script will exit
     #  and nothing will be published.
-    ( cd $RELEASE_ID && maven -o -Dgeronimo_version=$VERSION -Dmaven.{itest,test}.skip=true new ) || fail "Build failed"
+    export MAVEN_OPTS="-Xmx512m $MAVEN_OPTS" 
+    ( cd $RELEASE_ID && mvn -e -U -Dmaven.{itest,test}.skip=true install ) || fail "Build failed"
+}
 
+function gather_archives {
     #  During the assembly module a directory called geronimo-1.0-SVN_REVISION was created.  Let's 
     #  move in to that directory and create a geronimo-1.0-SVN_REVISION.zip and a tar.gz of the same name.
     #  When unpacked by users, these archives will extract into a directory called geronimo-1.0-SVN_REVISION/
-    cp $RELEASE_ID/assemblies/*/target/*.{zip,gz} $DIST/  || faile "Unable to copy in built files"
+    #cp $RELEASE_ID/assemblies/*/target/*.{zip,gz} $DIST/  || faile "Unable to copy in built files"
+    for archive in $RELEASE_ID/assemblies/*/target/*.{zip,gz}; do
+        cp $archive $DIST/$(basename ${archive/SNAPSHOT-bin/$SVN_VERSION})
+    done || fail "Unable to copy in built files"
 
     #  Let's create checksums for our source and binary tars and zips.
     for archive in $DIST/*.{zip,tar.gz}; do
-	echo $archive
-	shash md5 $archive
+        echo $archive
+        shash md5 $archive
         shash sha $archive
     done || fail "Unable to sign or hash release archives"
+}
+
+function publish_archives {
 
     #  Now we want to create a directory where we will put the archives and checksums up for download.
     #  Here we setup some variables for use.  The VERSION_DIR will typically look like:
@@ -137,11 +163,11 @@
     echo "Making dir $VERSION_DIR"
 
     if [ $RUNNING_LOCALLY ]; then
-	mkdir $VERSION_DIR || fail "Unable to create the release dir $VERSION_DIR"
-	cp -r $DIST/${RELEASE_ID}* $VERSION_DIR || fail "Unable to upload the binaries to release dir $VERSION_DIR"
+        mkdir $VERSION_DIR || fail "Unable to create the release dir $VERSION_DIR"
+        cp -r $DIST/${RELEASE_ID}* $VERSION_DIR || fail "Unable to upload the binaries to release dir $VERSION_DIR"
     else 
-	SSH_URL=$REMOTE_HOST
-	(scp -r $DIST $SSH_URL:$VERSION_DIR) || fail "Unable to upload the binaries to release dir $VERSION_DIR"
+        SSH_URL=$REMOTE_HOST
+        (scp -r $DIST $SSH_URL:$VERSION_DIR) || fail "Unable to upload the binaries to release dir $VERSION_DIR"
     fi
 
     #  Now we should be responsible and delete old nightly builds
@@ -176,4 +202,7 @@
     echo rm -r $DIST/* $RELEASE_ID
 }
 
-publish_build_archives
+checkout_source
+build_archives
+gather_archives
+#publish_build_archives