geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r724461 - in /geronimo/gbuild/daily_build_scripts: 2.0.cfg 2.1.cfg gbuild.sh trunk.cfg trunk.ibm.cfg trunk16.cfg
Date Mon, 08 Dec 2008 19:51:12 GMT
Author: dwoods
Date: Mon Dec  8 11:51:11 2008
New Revision: 724461

URL: http://svn.apache.org/viewvc?rev=724461&view=rev
Log:
allow gbuild.sh to be used for other builds (developers or tck), by allowing users to disable
emails, publishing and tck smoke tests (still enabled by default.)  also fixed where log and
mail files are genereated, so BASE_DIR and TEST_DIR can be in different places.

Modified:
    geronimo/gbuild/daily_build_scripts/2.0.cfg
    geronimo/gbuild/daily_build_scripts/2.1.cfg
    geronimo/gbuild/daily_build_scripts/gbuild.sh
    geronimo/gbuild/daily_build_scripts/trunk.cfg
    geronimo/gbuild/daily_build_scripts/trunk.ibm.cfg
    geronimo/gbuild/daily_build_scripts/trunk16.cfg

Modified: geronimo/gbuild/daily_build_scripts/2.0.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/2.0.cfg?rev=724461&r1=724460&r2=724461&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/2.0.cfg (original)
+++ geronimo/gbuild/daily_build_scripts/2.0.cfg Mon Dec  8 11:51:11 2008
@@ -14,5 +14,9 @@
 REMOTE_ACCOUNT=gawor
 REMOTE_HOME=/home/gawor
 
+BUILD_CLEAN=true
+BUILD_EMAIL=true
+BUILD_PUBLISH=true
+
 BINARY_URL=http://people.apache.org/builds/geronimo/server/binaries
 BINARY_DIR=/www/people.apache.org/builds/geronimo/server/binaries

Modified: geronimo/gbuild/daily_build_scripts/2.1.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/2.1.cfg?rev=724461&r1=724460&r2=724461&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/2.1.cfg (original)
+++ geronimo/gbuild/daily_build_scripts/2.1.cfg Mon Dec  8 11:51:11 2008
@@ -13,6 +13,9 @@
 REMOTE_ACCOUNT=gawor
 REMOTE_HOME=/home/gawor
 
+BUILD_CLEAN=true
+BUILD_EMAIL=true
+BUILD_PUBLISH=true
 BUILD_OPTS=-Pno-it
 
 BINARY_URL=http://people.apache.org/builds/geronimo/server/binaries

Modified: geronimo/gbuild/daily_build_scripts/gbuild.sh
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/gbuild.sh?rev=724461&r1=724460&r2=724461&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/gbuild.sh (original)
+++ geronimo/gbuild/daily_build_scripts/gbuild.sh Mon Dec  8 11:51:11 2008
@@ -24,7 +24,8 @@
 BRANCH=none
 BRANCH_ID=none
 BRANCH_DIR=none
-TCK_BRANCH=none
+TCK_BRANCH=
+SAMPLES_BRANCH=
 
 BASE_DIR=/home/prasad
 TEST_DIR=$BASE_DIR/geronimo
@@ -35,6 +36,9 @@
 REMOTE_ACCOUNT=prasad
 REMOTE_HOME=/home/prasad
 REMOTE_MACHINE=people.apache.org
+BUILD_CLEAN=true
+BUILD_EMAIL=true
+BUILD_PUBLISH=true
 
 BINARY_URL=http://people.apache.org/~${REMOTE_ACCOUNT}/binaries
 BINARY_DIR=${REMOTE_HOME}/public_html/binaries
@@ -52,7 +56,7 @@
   . "$CONFIG_FILE"
 else
   echo "ERROR: $CONFIG_FILE does not exist or is not a file"
-  exit 2
+  exit 1
 fi
 
 export MVN_HOME
@@ -63,14 +67,30 @@
 
 export PATH=$JRE_HOME/bin:$JAVA_HOME/bin:$MVN_HOME/bin:$PATH
 
+ts=`date +%T | awk -F: '{print $1$2}'`
+log=$BASE_DIR/build-$ts.log
+mail=$BASE_DIR/mail-$ts.log
+echo "Using logfile=$log"
+echo "" > $log
+
 function send_mail() {
    subject=$1
    mailto=$2
 
-   mail_ts=`date +%Y%m%d%H%M%S`
-   remote_mail_file=${REMOTE_HOME}/${mail_ts}.mail.txt
-   scp mail.txt ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$remote_mail_file
-   ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "mail -s '$subject' $mailto < $remote_mail_file;
rm -f $remote_mail_file"
+   if [ "$BUILD_EMAIL" = "true" ]
+   then
+     mail_ts=`date +%Y%m%d%H%M%S`
+     remote_mail_file=${REMOTE_HOME}/${mail_ts}.mail.txt
+     scp $mail ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$remote_mail_file
+     ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "mail -s '$subject' $mailto < $remote_mail_file;
rm -f $remote_mail_file"
+   else
+     echo " " >> $log
+     echo "Email is disabled, so logging details -" >> $log
+     echo "Subject: $subject" >> $log
+     echo "Body:" >> $log
+     cat $mail >> $log
+     echo " " >> $log
+  fi
 }
 
 
@@ -81,46 +101,53 @@
 count=`cat $BASE_DIR/ps.out | grep "gbuild.sh" | wc -l`
 if [ $count -gt 1 ]
 then
-  echo "Previous build is still running..." 
+  echo "ERROR: Previous build is still running..." 
   subject="[BUILD] ${BRANCH}: Previous build did not complete"
-  echo "Previous build is still running..." > mail.txt
-
+  echo "Previous build is still running..." > $mail
   send_mail "$subject" "$ADMIN_ADDR"
-  exit
+  exit 2
 fi
 
-ts=`date +%T | awk -F: '{print $1$2}'`
-log=build-$ts.log
-
-rm -rf $M2_REPO
-
-cd $TEST_DIR
-rm -rf $BRANCH_DIR
-svn co https://svn.apache.org/repos/asf/geronimo/server/$BRANCH $BRANCH_DIR
+if [ "$BUILD_CLEAN" = "true" ]
+then
+  rm -rf $M2_REPO
+  cd $TEST_DIR
+  rm -rf $BRANCH_DIR
+  echo "Running SVN CHECKOUT for Branch=$BRANCH"
+  echo "Running SVN CHECKOUT for Branch=$BRANCH" >> $log
+  svn co https://svn.apache.org/repos/asf/geronimo/server/$BRANCH $BRANCH_DIR
+else
+  cd $TEST_DIR
+  find . -name target | xargs rm -rf
+  echo "Running SVN UPDATE for Branch=$BRANCH"
+  echo "Running SVN UPDATE for Branch=$BRANCH" >> $log
+  svn up $BRANCH_DIR
+fi
 if [ $? -ne 0 ]
 then
-  echo "SVN checkout failed."
+  echo "ERROR: SVN checkout failed."
   subject="[BUILD] ${BRANCH}: SVN checkout failed"
-  echo "SVN checkout failed." > mail.txt
-
+  echo "SVN checkout failed." > $mail
   send_mail "$subject" "$ADMIN_ADDR"
-  exit
+  exit 3
 fi
 
 cd $BRANCH_DIR
 rev=`svn info | grep Revision`
 
-echo "Building Geronimo ${BRANCH} at $rev" > $log
+echo "Building Geronimo ${BRANCH} at $rev"
+echo "Building Geronimo ${BRANCH} at $rev" >> $log
 echo " " >> $log
 java -version >> $log 2>&1
 echo " " >> $log
 
 function build() {
-  mvn -B -e -Dmaven.test.skip=$1 $BUILD_OPTS install > temp
+  mvn -B -e -Dmaven.test.skip=$1 $BUILD_OPTS install > temp 2>$1
   tail -100 temp | grep "Missing:"
   if [ $? -eq 0 ]
   then
-    mvn -B -e -Dmaven.test.skip=$1 $BUILD_OPTS install > temp
+    echo "Rebuilding due to missing depend..."
+    mvn -B -e -Dmaven.test.skip=$1 $BUILD_OPTS install > temp 2>$1
   fi
   cat temp >> $log
   rm -f temp
@@ -150,55 +177,70 @@
 
 build $SKIP_TESTS
 
-dir=`date +%F | awk -F- '{print $1$2$3}'`
-bin_dir=$BINARY_DIR/$BRANCH_DIR/$dir
-latest_dir=$BINARY_DIR/$BRANCH_DIR/latest
-ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "mkdir -p $bin_dir"
-scp $log ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$bin_dir
-
 if [ "$SKIP_TESTS" = "true" ]
 then
-  echo "Geronimo $rev built with tests skipped" >> mail.txt
+  echo "Unit tests skiped"
+  echo "Geronimo $rev built with tests skipped" >> $mail
 else
-  echo "Geronimo $rev built with tests included" >> mail.txt
+  echo "Unit tests included"
+  echo "Geronimo $rev built with tests included" >> $mail
 fi
 
-echo " " >> mail.txt
-echo "See the full $log file at $BINARY_URL/$BRANCH_DIR/$dir/$log" >> mail.txt
-echo " " >> mail.txt
+dir=`date +%F | awk -F- '{print $1$2$3}'`
+bin_dir=$BINARY_DIR/$BRANCH_DIR/$dir
+latest_dir=$BINARY_DIR/$BRANCH_DIR/latest
+if [ "$BUILD_PUBLISH" = "true" ]
+then
+  echo "Publishing build log..."
+  ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "mkdir -p $bin_dir"
+  scp $log ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$bin_dir
+  echo " " >> $mail
+  echo "See the full $log file at $BINARY_URL/$BRANCH_DIR/$dir/$log" >> $mail
+  echo " " >> $mail
+fi
 
 grep "BUILD SUCCESSFUL" $log
 if [ $? -eq 0 ]
 then
-   echo "Download the binaries from $BINARY_URL/$BRANCH_DIR/$dir" >> mail.txt
-
-   result="passed"
-   grep -A10 "BUILD SUCCESSFUL" $log >> mail.txt
+  echo "Server build Successful.  See $log for details."
+  result="passed"
+  grep -A10 "BUILD SUCCESSFUL" $log >> $mail
 
-   cd $TEST_DIR/$BRANCH_DIR/assemblies
-   for i in `find . -name *ee5*.zip`
-   do
-     scp $i ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$bin_dir
-   done
+  if [ "$BUILD_PUBLISH" = "true" ]
+  then
+    echo "Publishing assemblies..."
+    echo "Download the binaries from $BINARY_URL/$BRANCH_DIR/$dir" >> $mail
+    cd $TEST_DIR/$BRANCH_DIR/assemblies
+    for i in `find . -name *ee5*.zip`
+    do
+      scp $i ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$bin_dir
+    done
 
-   # fix permissions
-   ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "chmod -R g+w $bin_dir"
+    # fix permissions
+    ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "chmod -R g+w $bin_dir"
 
-   cd ..
+    cd ..
+  fi
    
    if [ "$SKIP_TESTS" = "false" ]
    then
+     echo "Running testsuite..."
      . $SCRIPT_DIR/testsuite.sh ${BRANCH_ID} ${BRANCH_DIR}
 
      grep -E "BUILD ERROR|FAILURE!|Failed to start Geronimo server" $mergedTestLog
      if [ $? -eq 0 ]
      then
+       echo "Testsuite Failed"
        result="failed"
      else
-       # if build and tests passed, then update link to latest build for GEP
-       ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "rm -f $latest_dir"
-       ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "ln -s $bin_dir $latest_dir"
-       ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "chmod g+w $latest_dir"
+       echo "Testsuite Passed"
+       if [ "$BUILD_PUBLISH" = "true" ]
+       then
+         # if build and tests passed, then update link to latest build for GEP
+         ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "rm -f $latest_dir"
+         ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "ln -s $bin_dir $latest_dir"
+         ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "chmod g+w $latest_dir"
+       fi
      fi
 
    fi
@@ -206,32 +248,43 @@
    if [ -n "$SAMPLES_BRANCH" ] 
    then
       PREV_PWD=$PWD
+      "Building Samples..."
       . $SCRIPT_DIR/samples.sh ${SAMPLES_BRANCH}
       cd $PREV_PWD
    fi
 
    mail_results $result
 
-   PREV_PWD=$PWD
-   . $SCRIPT_DIR/tck.sh ${BRANCH_ID} ${TCK_BRANCH}
-   cd $PREV_PWD
+   if [ -n "$TCK_BRANCH" ] 
+   then
+     PREV_PWD=$PWD
+     echo "Running TCK smoke tests..."
+     . $SCRIPT_DIR/tck.sh ${BRANCH_ID} ${TCK_BRANCH}
+     cd $PREV_PWD
+   fi
 
+   exit 0
 else
-  # if build failed, publish unit test reports
-  UNIT_DIR=$TEST_DIR/$BRANCH_DIR/unit-test-reports
-  copyUnitTestReports
-  scp -r $UNIT_DIR ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$bin_dir
-
-  # fix permissions
-  ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "chmod -R g+w $bin_dir"
-
-  echo " " >> mail.txt
-  echo "See the unit test reports at $BINARY_URL/$BRANCH_DIR/$dir/unit-test-reports" >>
mail.txt
-  echo " " >> mail.txt
+  echo "Server build Failed.  See $log for details."
+  if [ "$BUILD_PUBLISH" = "true" ]
+  then
+    echo "Publishing unit-test-reports..."
+    # if build failed, publish unit test reports
+    UNIT_DIR=$TEST_DIR/$BRANCH_DIR/unit-test-reports
+    copyUnitTestReports
+    scp -r $UNIT_DIR ${REMOTE_ACCOUNT}@${REMOTE_MACHINE}:$bin_dir
+
+    # fix permissions
+    ssh ${REMOTE_ACCOUNT}@${REMOTE_MACHINE} "chmod -R g+w $bin_dir"
+
+    echo " " >> $mail
+    echo "See the unit test reports at $BINARY_URL/$BRANCH_DIR/$dir/unit-test-reports" >>
$mail
+    echo " " >> $mail
+  fi
 
-  tail -100 $log >> mail.txt
+  tail -100 $log >> $mail
   mail_results "failed"
 
+  exit 99
 fi
 
-exit 0

Modified: geronimo/gbuild/daily_build_scripts/trunk.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/trunk.cfg?rev=724461&r1=724460&r2=724461&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/trunk.cfg (original)
+++ geronimo/gbuild/daily_build_scripts/trunk.cfg Mon Dec  8 11:51:11 2008
@@ -4,16 +4,24 @@
 TCK_BRANCH=branches/2.2
 SAMPLES_BRANCH=trunk
 
-SCRIPT_DIR=/home/geronimo/daily_build_scripts
 BASE_DIR=/home/geronimo
+SCRIPT_DIR=$BASE_DIR/daily_build_scripts
 TEST_DIR=$BASE_DIR/geronimo
 M2_REPO=$BASE_DIR/.m2/repository
 
+#MVN_HOME=/usr/local/maven
+#SUN_JAVA_HOME=/usr/local/java
+#JAVA_HOME=$SUN_JAVA_HOME
+
 ADMIN_ADDR="gawor@apache.org jawarner@apache.org"
 REMOTE_ACCOUNT=gawor
 REMOTE_HOME=/home/gawor
 
+BUILD_CLEAN=true
+BUILD_EMAIL=true
+BUILD_PUBLISH=true
 BUILD_OPTS=-Pno-it
 
 BINARY_URL=http://people.apache.org/builds/geronimo/server/binaries
 BINARY_DIR=/www/people.apache.org/builds/geronimo/server/binaries
+

Modified: geronimo/gbuild/daily_build_scripts/trunk.ibm.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/trunk.ibm.cfg?rev=724461&r1=724460&r2=724461&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/trunk.ibm.cfg (original)
+++ geronimo/gbuild/daily_build_scripts/trunk.ibm.cfg Mon Dec  8 11:51:11 2008
@@ -16,6 +16,9 @@
 REMOTE_ACCOUNT=gawor
 REMOTE_HOME=/home/gawor
 
+BUILD_CLEAN=true
+BUILD_EMAIL=true
+BUILD_PUBLISH=true
 BUILD_OPTS=-Pno-it
 
 BINARY_URL=http://people.apache.org/builds/geronimo/server/binaries

Modified: geronimo/gbuild/daily_build_scripts/trunk16.cfg
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/trunk16.cfg?rev=724461&r1=724460&r2=724461&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/trunk16.cfg (original)
+++ geronimo/gbuild/daily_build_scripts/trunk16.cfg Mon Dec  8 11:51:11 2008
@@ -17,6 +17,9 @@
 REMOTE_ACCOUNT=gawor
 REMOTE_HOME=/home/gawor
 
+BUILD_CLEAN=true
+BUILD_EMAIL=true
+BUILD_PUBLISH=true
 BUILD_OPTS=-Pno-it
 
 BINARY_URL=http://people.apache.org/builds/geronimo/server/binaries



Mime
View raw message