geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r453061 - /geronimo/gbuild/scripts/publish_build.sh
Date Wed, 04 Oct 2006 23:11:10 GMT
Author: dain
Date: Wed Oct  4 16:11:10 2006
New Revision: 453061

URL: http://svn.apache.org/viewvc?view=rev&rev=453061
Log:
Now updated geronimo and openejb version numbers to be -r${SVN_REVISION}
Now checks out and builds OpenEJB with the same revision number as geronimo

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=453061&r1=453060&r2=453061
==============================================================================
--- geronimo/gbuild/scripts/publish_build.sh (original)
+++ geronimo/gbuild/scripts/publish_build.sh Wed Oct  4 16:11:10 2006
@@ -48,8 +48,6 @@
 #  relatively good state.
 RELEASE_DIR=${2:-/www/people.apache.org/dist/geronimo/unstable}
 
-PROJ=geronimo
-BIN_DIR=modules/assembly/target
 DIST=$PWD/dist
 
 #  Make the DIST directory if it isn't present
@@ -57,27 +55,29 @@
 test -d $DIST || mkdir $DIST
 
 #  The public repo url for geronimo
-SVN_URL="http://svn.apache.org/repos/asf/$PROJ"
-SVN_PATH="server/trunk"
+ASF_REPO="http://svn.apache.org/repos/asf"
+GSVN_PATH="geronimo/server/trunk"
+OSVN_PATH="incubator/openejb/trunk/openejb2"
 
 #  Get the current svn revision number for geronimo
 #  Example: 123456
-export SVN_VERSION=$(wget -q -O - $SVN_URL/$SVN_PATH | grep title | sed 's/[^0-9]//g')
+export SVN_VERSION=$(wget -q -O - $ASF_REPO/$GSVN_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.2'
+GVN='1.2'
+OVN='2.2'
 
-#  Example value: 1.0-123456
-VERSION="$VN-$SVN_VERSION"
+#  Example value: 1.0-r123456
+GVERSION="$GVN-r$SVN_VERSION"
+OVERSION="$OVN-r$SVN_VERSION"
+
+#  Example value: geronimo-1.0-r123456
+GRELEASE_ID="geronimo-$GVERSION"
+ORELEASE_ID="openejb-$OVERSION"
 
-#  Example value: geronimo-1.0-123456
-RELEASE_ID="$PROJ-$VERSION"
-
-#  Example value: /www/cvs.apache.org/dist/geronimo/unstable/1.0-123456
-VERSION_DIR="$RELEASE_DIR/$VERSION"
-
-echo "$RELEASE_ID"
+echo "$GRELEASE_ID"
+echo "$ORELEASE_ID"
 
 ### Build functions ########
 function package () { 
@@ -85,20 +85,41 @@
     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,(</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/;

-$p2=$p1; $p1=$_;
-' plugins/*/project.xml plugins/geronimo-packaging-plugin/src/test-resources/*.xml
-
-        #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
 
+function replace_version {
+    # change geronimo root pom version to 
+    perl -i.orig -pe '
+        $inParent = 1 if /<parent>/;
+        s,-SNAPSHOT</version>,-r$ENV{SVN_VERSION}</version>, if not $inParent
and not $done;
+        $inParent = 0 if $inParent and /<\/parent>/;
+        $done = 1 if /<properties>/ or /<dependencyManagement>/ or /<build>/;
+        s,-SNAPSHOT</openejbVersion>,-r$ENV{SVN_VERSION}</openejbVersion>,;
+    ' $GRELEASE_ID/pom.xml
+
+    # update geronimo parent/version in all child poms
+    perl -i.orig -pe '
+        $done = 0 if /<\?xml/;
+        $inParent = 1 if not $done and /<parent>/;
+        s,-SNAPSHOT</version>,-r$ENV{SVN_VERSION}</version>, if $inParent and
not $done;
+        $done = $inParent = 1 if /<\/parent>/;
+    ' $(find $GRELEASE_ID -name pom.xml | grep -v "$GRELEASE_ID/pom.xml")
+
+    # change openejb root pom version to 
+    perl -i.orig -pe '
+        $inParent = 1 if /<parent>/;
+        s,-SNAPSHOT</version>,-r$ENV{SVN_VERSION}</version>, if not $inParent
and not $done;
+        $inParent = 0 if $inParent and /<\/parent>/;
+        $done = 1 if /<properties>/ or /<dependencyManagement>/ or /<build>/;
+        s,-SNAPSHOT</geronimoVersion>,-r$ENV{SVN_VERSION}</geronimoVersion>,;
+    ' $ORELEASE_ID/pom.xml
+
+    # update openejb parent/version in all child poms
+    perl -i.orig -pe '
+        $done = 0 if /<\?xml/;
+        $inParent = 1 if not $done and /<parent>/;
+        s,-SNAPSHOT</version>,-r$ENV{SVN_VERSION}</version>, if $inParent and
not $done;
+        $done = $inParent = 1 if /<\/parent>/;
+    ' $(find $ORELEASE_ID -name pom.xml | grep -v "$ORELEASE_ID/pom.xml")
 }
 
 function checkout_source {
@@ -107,16 +128,23 @@
     #  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/$SVN_PATH $RELEASE_ID || fail "svn export
failed"
+    #  The directory will be named geronimo-1.0-rSVN_REVISION_NUMBER
+    svn checkout --revision $SVN_VERSION $ASF_REPO/$GSVN_PATH $GRELEASE_ID || fail "svn export
failed"
+    svn checkout --revision $SVN_VERSION $ASF_REPO/$OSVN_PATH $ORELEASE_ID || fail "svn export
failed"
  
     # Replace the version number in the poms with our svn version number
-#    ( cd $RELEASE_ID && replace_version )
+    replace_version
+
+    # create the change log
+    # TODO remove from here and add to boilerplate mvn
+    #java -jar swizzle.jar roadmap.vm > $DIST/CHANGELOG.txt 
+    #cp $DIST/CHANGELOG.txt $GRELEASE_ID/assemblies/geronimo-boilerplate-minimal/src/main/resources/
+
 
     #  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"
+    package $DIST/${RELEASE_ID}-src $GRELEASE_ID || fail "Unable to create source binaries"
 }
 
 function build_archives {
@@ -125,16 +153,17 @@
     #  If the build fails to compile, the 'fail' function is called and this script will
exit
     #  and nothing will be published.
     export MAVEN_OPTS="-Xmx512m $MAVEN_OPTS" 
-    ( cd $RELEASE_ID && mvn -e -U -Dmaven.{itest,test}.skip=true install ) || fail
"Build failed"
+    ( cd $GRELEASE_ID && mvn -e -U -Dmaven.{itest,test}.skip=true -Dstage=bootstrap
) || fail "Build failed"
+    ( cd $ORELEASE_ID && mvn -e -U -Dmaven.{itest,test}.skip=true install ) || fail
"Build failed"
+    ( cd $GRELEASE_ID && mvn -e -U -Dmaven.{itest,test}.skip=true -Dstage=assemble
) || 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"
-    for archive in $RELEASE_ID/assemblies/*/target/*.{zip,gz}; do
-        cp $archive $DIST/$(basename ${archive/SNAPSHOT-bin/$SVN_VERSION})
+    for archive in $GRELEASE_ID/assemblies/*/target/*.{zip,gz}; do
+        cp $archive $DIST/$(basename ${archive/-bin/})
     done || fail "Unable to copy in built files"
 
     #  Let's create checksums for our source and binary tars and zips.
@@ -151,7 +180,7 @@
     #  Here we setup some variables for use.  The VERSION_DIR will typically look like:
     #     /www/cvs.apache.org/dist/geronimo/unstable/1.0-SVN_REVISION/
     #  This is the directory on apache.org where non-release builds a placed.
-    VERSION_DIR=$RELEASE_DIR/$VERSION
+    VERSION_DIR=$RELEASE_DIR/$GVERSION
 
     #  At this point we are mostly done, we just need to make our release directory and copy
the files.
     #
@@ -199,7 +228,7 @@
     [ "$DELETE_LIST" ] && ( $SSH "cd $RELEASE_DIR && rm -r $DELETE_LIST"
)
 
     #  clean up locally
-    echo rm -r $DIST/* $RELEASE_ID
+    echo rm -r $DIST/* $GRELEASE_ID
 }
 
 checkout_source



Mime
View raw message