geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r599147 - in /geronimo/gbuild/daily_build_scripts: 2.0.cfg gbuild.sh testsuite.sh trunk.cfg
Date Wed, 28 Nov 2007 21:05:32 GMT
Author: gawor
Date: Wed Nov 28 13:05:32 2007
New Revision: 599147

URL: http://svn.apache.org/viewvc?rev=599147&view=rev
Log:
refactored the script so that one script works with different branches

Added:
    geronimo/gbuild/daily_build_scripts/2.0.cfg
    geronimo/gbuild/daily_build_scripts/trunk.cfg
Modified:
    geronimo/gbuild/daily_build_scripts/gbuild.sh
    geronimo/gbuild/daily_build_scripts/testsuite.sh

Added: geronimo/gbuild/daily_build_scripts/2.0.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/2.0.cfg?rev=599147&view=auto
==============================================================================
--- geronimo/gbuild/daily_build_scripts/2.0.cfg (added)
+++ geronimo/gbuild/daily_build_scripts/2.0.cfg Wed Nov 28 13:05:32 2007
@@ -0,0 +1,5 @@
+BRANCH=branches/2.0
+BRANCH_ID=2.0
+BRANCH_DIR=2.0
+TCK_BRANCH=2.0
+BUILD_OPENEJB=false

Modified: geronimo/gbuild/daily_build_scripts/gbuild.sh
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/gbuild.sh?rev=599147&r1=599146&r2=599147&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/gbuild.sh (original)
+++ geronimo/gbuild/daily_build_scripts/gbuild.sh Wed Nov 28 13:05:32 2007
@@ -21,42 +21,80 @@
 
 # -----------------------------------------------------------------------------
 
+BRANCH=none
+BRANCH_ID=none
+BRANCH_DIR=none
+TCK_BRANCH=none
+BUILD_OPENEJB=false
+
+CONFIG_FILE=$1
+RUN_TESTS=$2
+
+if [ -f "$CONFIG_FILE" ]; then
+  . "$CONFIG_FILE"
+else
+  echo "ERROR: $CONFIG_FILE does not exist or is not a file"
+  exit 2
+fi
+
 export MVN_HOME=/usr/local/maven
 export JAVA_HOME=/usr/local/java
 export JRE_HOME=/usr/lib/jvm/jre
 export PATH=$JRE_HOME/bin:$JAVA_HOME/bin:$MVN_HOME/bin:$PATH
 export MAVEN_OPTS="-XX:MaxPermSize=256m -Xms512m -Xmx1024m"
 
-echo `date` > /home/prasad/date.log
+BASE_DIR=/home/prasad
+TEST_DIR=$BASE_DIR/geronimo
+M2_REPO=$BASE_DIR/.m2/repository
+ADMIN_ADDR=prasad@apache.org,gawor@apache.org
+
+echo `date` > $BASE_DIR/date.log
+
+# check if another gbuild script is still running
+ps > $BASE_DIR/ps.out
+count=`cat $BASE_DIR/ps.out | grep "gbuild.sh" | wc -l`
+if [ $count -gt 1 ]
+then
+  subject="[BUILD] ${BRANCH_ID}: Previous build did not complete"
+  echo "" > mail.txt
+  scp mail.txt prasad@people:/home/prasad
+  ssh prasad@people "mail -s '$subject' $ADMIN_ADDR < mail.txt"
+  exit
+fi
 
 ts=`date +%T | awk -F: '{print $1$2}'`
 log=build-$ts.log
 
 dir=`date +%F | awk -F- '{print $1$2$3}'`
-bin_dir=/home/prasad/public_html/binaries/trunk/$dir
+bin_dir=/home/prasad/public_html/binaries/$BRANCH_DIR/$dir
 ssh prasad@people mkdir $bin_dir
 
-rm -rf /home/prasad/.m2/repository
+rm -rf $M2_REPO
 
-#Build OpenEJB first.
-#. /home/prasad/bin/openejb.sh
-scp prasad@zones:/export/home/prasad/geronimo/binary/openejb.tar .
-tar -xvf openejb.tar
-scp prasad@zones:/export/home/prasad/geronimo/binary/openejbrev.txt .
-openejbrev=`cat openejbrev.txt` 
-
-cd /home/prasad/geronimo
-rm -rf trunk
-svn co https://svn.apache.org/repos/asf/geronimo/server/trunk trunk
-cd trunk
+if [ "$BUILD_OPENEJB" = "true" ]
+then
+  #Build OpenEJB first.
+  #. /home/prasad/bin/openejb.sh
+  scp prasad@zones:/export/home/prasad/geronimo/binary/openejb.tar .
+  tar -xvf openejb.tar
+  scp prasad@zones:/export/home/prasad/geronimo/binary/openejbrev.txt .
+  openejbrev=`cat openejbrev.txt` 
+fi
+
+cd $TEST_DIR
+rm -rf $BRANCH_DIR
+svn co https://svn.apache.org/repos/asf/geronimo/server/$BRANCH $BRANCH_DIR
+cd $BRANCH_DIR
 rev=`svn info | grep Revision`
 
-echo "Building Geronimo trunk at $rev" > $log
-echo "Building OpenEJB trunk at $openejbrev" >> $log
+echo "Building Geronimo ${BRANCH} at $rev" > $log
+if [ "$BUILD_OPENEJB" = "true" ]
+then
+  echo "Building OpenEJB trunk at $openejbrev" >> $log
+  echo "OpenEJB trunk at $openejbrev" >> mail.txt
+fi
 echo " " >> $log
 
-echo "OpenEJB trunk at $openejbrev" >> mail.txt
-
 function build() {
   mvn -B -e -Dmaven.test.skip=$1 install > temp
   tail -100 temp | grep "Missing:"
@@ -71,51 +109,50 @@
 function mail_results() {
    if [ "$1" = "passed" ]
    then
-      subject="[BUILD] 2.1: Successful"
+      subject="[BUILD] ${BRANCH_ID}: Successful"
       mailto="scm@geronimo.apache.org"
    else
-      subject="[BUILD] 2.1: Failed for $rev"
+      subject="[BUILD] ${BRANCH_ID}: Failed for $rev"
       mailto="dev@geronimo.apache.org"
    fi
    scp mail.txt prasad@people:/home/prasad
    ssh prasad@people "mail -s '$subject' $mailto < mail.txt"
 }
 
-build $1
+
+build $RUN_TESTS
 scp $log prasad@people:$bin_dir
 
-if [ "$1" = "true" ]
+if [ "$RUN_TESTS" = "true" ]
 then
   echo "Geronimo $rev built with tests skipped" >> mail.txt
 else
-#  mvn -B -Dmaven.test.skip=true deploy >> deploy.log
   echo "Geronimo $rev built with tests included" >> mail.txt
 fi
 
 echo " " >> mail.txt
-echo "See the full $log file at http://people.apache.org/~prasad/binaries/trunk/$dir/$log"
>> mail.txt
+echo "See the full $log file at http://people.apache.org/~prasad/binaries/$BRANCH_DIR/$dir/$log"
>> mail.txt
 echo " " >> mail.txt
 
 grep "BUILD SUCCESSFUL" $log
 if [ $? -eq 0 ]
 then
-   echo "Download the binaries from http://people.apache.org/~prasad/binaries/trunk/$dir"
>> mail.txt
+   echo "Download the binaries from http://people.apache.org/~prasad/binaries/$BRANCH_DIR/$dir"
>> mail.txt
 
    result="passed"
    grep -A10 "BUILD SUCCESSFUL" $log >> mail.txt
 
-   cd /home/prasad/geronimo/trunk/assemblies
-
-   for i in `find . -name *javaee5*.zip`
+   cd $TEST_DIR/$BRANCH_DIR/assemblies
+   for i in `find . -name *ee5*.zip`
    do
      scp $i prasad@people:$bin_dir
    done
 
    cd ..
    
-   if [ "$1" = "false" ]
+   if [ "$RUN_TESTS" = "false" ]
    then
-     . /home/prasad/bin/testsuite.sh 2.1 trunk
+     . /home/prasad/bin/testsuite.sh ${BRANCH_ID} ${BRANCH_DIR}
 
      grep -E "BUILD ERROR|FAILURE!|Failed to start Geronimo server" $testLog
      if [ $? -eq 0 ]
@@ -127,7 +164,7 @@
 
    mail_results $result
 
-   . /home/prasad/bin/tck.sh 2.1
+   . /home/prasad/bin/tck.sh ${TCK_BRANCH}
 
 else
   tail -100 $log >> mail.txt

Modified: geronimo/gbuild/daily_build_scripts/testsuite.sh
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/testsuite.sh?rev=599147&r1=599146&r2=599147&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/testsuite.sh (original)
+++ geronimo/gbuild/daily_build_scripts/testsuite.sh Wed Nov 28 13:05:32 2007
@@ -28,8 +28,9 @@
 export PATH=$JRE_HOME/bin:$JAVA_HOME/bin:$MVN_HOME/bin:$PATH:/usr/X11R6/bin:$FIREFOX_HOME
 export MAVEN_OPTS="-XX:MaxPermSize=128m -Xms512m -Xmx1024m"
 
-BRANCH=$2
-TEST_DIR=/home/prasad/geronimo/$BRANCH
+BRANCH_ID=$1
+BRANCH_DIR=$2
+TEST_DIR=/home/prasad/geronimo/$BRANCH_DIR
 
 LOG_DIR_NAME=logs-$ts
 LOG_DIR=$TEST_DIR/$LOG_DIR_NAME
@@ -50,7 +51,7 @@
 
 cd $TEST_DIR/testsuite
 mvn -B -Pheadless,default -DassemblyId=tomcat -DexcludeTest=test-jetty > $testLog
-mvn -B site-deploy -DbuildNumber=$ds-$1 > deploy.log
+mvn -B site-deploy -DbuildNumber=$ds-$BRANCH_ID > deploy.log
 
 createLogsDir geronimo.log
 
@@ -60,7 +61,7 @@
 echo "TESTSUITE RESULTS (Failures only)" >> ../mail.txt
 echo "=================================" >> ../mail.txt
 echo "See detailed results at http://people.apache.org/~prasad/testsuite/ResultsSummary.html"
>> ../mail.txt
-echo "See the full test.log file at http://people.apache.org/~prasad/binaries/$BRANCH/$dir/$LOG_DIR_NAME/test.log"
>> ../mail.txt
+echo "See the full test.log file at http://people.apache.org/~prasad/binaries/$BRANCH_DIR/$dir/$LOG_DIR_NAME/test.log"
>> ../mail.txt
 echo " " >> ../mail.txt
 grep -E "Running|FAILURE!" $testLog | grep -B1 "FAILURE!" >> ../mail.txt
 echo " " >> ../mail.txt

Added: geronimo/gbuild/daily_build_scripts/trunk.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/trunk.cfg?rev=599147&view=auto
==============================================================================
--- geronimo/gbuild/daily_build_scripts/trunk.cfg (added)
+++ geronimo/gbuild/daily_build_scripts/trunk.cfg Wed Nov 28 13:05:32 2007
@@ -0,0 +1,5 @@
+BRANCH=trunk
+BRANCH_ID=2.1
+BRANCH_DIR=trunk
+TCK_BRANCH=2.1
+BUILD_OPENEJB=true



Mime
View raw message