Author: jmitchell
Date: Mon Feb 13 18:45:48 2006
New Revision: 377586

URL: http://svn.apache.org/viewcvs?rev=377586&view=rev
Log:
Update build script (used to build the nightlies on our zone via cron)


Modified:
    struts/current/nightly.sh

Modified: struts/current/nightly.sh
URL: 
http://svn.apache.org/viewcvs/struts/current/nightly.sh?rev=377586&r1=377585&r2=377586&view=diff
==============================================================================
--- struts/current/nightly.sh (original)
+++ struts/current/nightly.sh Mon Feb 13 18:45:48 2006
@@ -3,46 +3,68 @@
 # This is the exact cron job to that builds
 # the nightly Apache Struts distributions
 #
-# 30 1 * * * /home/jmitchell/svn/nightly.sh
+# 30 1 * * * /export/home/jmitchell/svn/nightly.sh
 # 
 #####################
 
+export USER_HOME=/export/home/jmitchell
+source $USER_HOME/.bashrc
 
-source ~/.bashrc
-
-export SVN_DIR=/home/jmitchell/svn
-
-cd $SVN_DIR/STRUTS_1_2_BRANCH
+env
 
+echo "--- setup environment for this build ---"
+export SVN_DIR=/export/home/jmitchell/svn
 export TODAY=`date +%Y%m%d`
-export LOGFILE=$SVN_DIR/../logs/nightly-$TODAY.log
-export UPLOAD_DIR=$SVN_DIR/STRUTS_1_2_BRANCH/release/upload
-export 
TARGET_HOST=cvs.apache.org:/www/cvs.apache.org/builds/jakarta-struts/maven/
+export SOURCE_1_2_DIR=$SVN_DIR/STRUTS_1_2_BRANCH/release/upload
+export 
TARGET_HOST=svn.apache.org:/www/cvs.apache.org/builds/jakarta-struts/maven/
 export TARGET_1_2_URL=$TARGET_HOST/STRUTS_1_2_BRANCH/nightly
 export TARGET_1_3_URL=$TARGET_HOST/trunk/
 export NIGHTLIES=$SVN_DIR/struts/build/nightly
+env
 
-ant clean-lib > $LOGFILE
-svn status >> $LOGFILE
-ant download-dependencies nightly >> $LOGFILE
-#ant site >> $LOGFILE
-
-
-scp $UPLOAD_DIR/*bin* $TARGET_1_2_URL/binary >> $LOGFILE
-scp $UPLOAD_DIR/*lib* $TARGET_1_2_URL/lib >> $LOGFILE
-scp $UPLOAD_DIR/*src* $TARGET_1_2_URL/src >> $LOGFILE
-scp $LOGFILE $TARGET_1_2_URL/logs
-
-
-# TODO - build and deploy 1.2 web site
-
-# build and deploy 1.3.x
-cd $SVN_DIR/struts/build/ >> $LOGFILE
-maven nightly >> $LOGFILE
-cp $LOGFILE $NIGHTLIES/logs
+echo "-------- Struts 1.2.x -------------"
+echo "--- move old 1.2 branch to bak/ ---"
+cd $SVN_DIR
+mv STRUTS_1_2_BRANCH STRUTS_1_2_BRANCH-$TODAY
+
+echo "--- get a fresh checkout from svn ---"
+svn co 
https://svn.apache.org/repos/asf/struts/action/branches/STRUTS_1_2_BRANCH/ 
STRUTS_1_2_BRANCH
+cd STRUTS_1_2_BRANCH
+
+echo "--- #ant download-dependencies releasee ---"
+ant download-dependencies nightly
+
+echo "--- push the artifacts to the nightly drop ---"
+scp $SOURCE_1_2_DIR/*bin* $TARGET_1_2_URL/binary 
+scp $SOURCE_1_2_DIR/*lib* $TARGET_1_2_URL/lib 
+scp $SOURCE_1_2_DIR/*src* $TARGET_1_2_URL/src 
+
+
+cd $SVN_DIR
+cp build.log bak/build.log-$TODAY
+scp bak/build-$TODAY.log $TARGET_1_2_URL/logs
+echo "" > build.log
+
+echo "-------- Struts 1.3.x -------------"
+echo "--- move old 1.3 branch to bak/ ---"
+cd $SVN_DIR
+mv struts bak/struts-$TODAY
+
+echo "--- get a fresh checkout from svn ---"
+svn co http://svn.apache.org/repos/asf/struts/current/ struts
+
+echo "--- build and deploy 1.3.x ---"
+cd $SVN_DIR/struts/build/
+maven nightly
 scp -r $NIGHTLIES $TARGET_1_3_URL
 
 
+echo "--- copy build.log ---"
+cd $SVN_DIR
+cp build.log bak/build.log-$TODAY
+scp bak/build-$TODAY.log $TARGET_1_3_URL/nightly/logs
 
+echo "--- clean up folder history ---"
+find /home/jmitchell/svn/bak -type f -mtime +7 -exec rm -fr \{\} \;
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to