Author: bayard
Date: Mon Nov 13 16:46:35 2006
New Revision: 474610

URL: http://svn.apache.org/viewvc?view=rev&rev=474610
Log:
Pulled the configuation out of the nightl build script so it can be run in 
multiple places. This is mostly useful for debug. The vmbuild variant is a 
default, rather than having an error happen when no option is passed in. Also I 
have modified the script such that if there are do deploy or maven_ deploy 
parameters, it doesn't try to do this. 

Added:
    jakarta/commons/proper/commons-build/trunk/vmbuild.conf
Modified:
    jakarta/commons/proper/commons-build/trunk/commons_nightly.sh

Modified: jakarta/commons/proper/commons-build/trunk/commons_nightly.sh
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/commons-build/trunk/commons_nightly.sh?view=diff&rev=474610&r1=474609&r2=474610
==============================================================================
--- jakarta/commons/proper/commons-build/trunk/commons_nightly.sh (original)
+++ jakarta/commons/proper/commons-build/trunk/commons_nightly.sh Mon Nov 13 
16:46:35 2006
@@ -26,30 +26,32 @@
 #
 # Assumes $proper_root points to a checkout of commons proper trunks
 # and similarly for $sandbox_root
-#==============================================================================
-# Configuration
-#==============================================================================
-# Notes: 1) Path specifications are absolute
-#        2) $deploy_user must have an ssh key on the build host that is
-#           authorized on the $deploy_host
-#==============================================================================
-proper_root="/home/psteitz/trunks-proper"     # local commons proper checkout  
 
-sandbox_root="/home/psteitz/trunks-sandbox"   # local sandbox checkout
-deploy_host="people.apache.org"               # deployment host
-deploy_user="psteitz"                         # user on the deployment host
-# path to component lists
-nightly_list_location="${proper_root}/commons-build"  
-# deployment path on $deploy_host
-deploy_location="/x1/www/people.apache.org/builds/jakarta-commons/nightly"   
-log_location="/home/psteitz/log"              # where to put logs
-report_location="/home/psteitz/build_report"
-time_stamp=`date +%Y%m%d`                     # time stamp in file names
-ant_build="/home/psteitz/build"               # Ant build directory
-maven_snapshot_host='people.apache.org'         # Maven snapshot host
-maven_snapshot_user='psteitz'
-maven_snapshot_directory='/www/people.apache.org/repo/m1-snapshot-repository'
-log_url='http://people.apache.org/~psteitz/commons-nightlies'
-notification_email='[email protected]'
+
+if [ $# -eq 0 ]
+then
+    config="vmbuild.conf"    # backwards compat until the crontab is changed
+else
+    config=$1
+fi
+
+source $config
+
+echo $config
+
+exit
+
+DIST_DEPLOY='true'
+if [ -z "$deploy_user" -o -z "$deploy_location" -o -z "$deploy_host" ]
+then
+  unset DIST_DEPLOY
+fi
+
+MAVEN_DEPLOY='true'
+if [ -z "$maven_snapshot_user" -o -z "$maven_snapshot_directory" -o -z 
"$maven_snapshot_host" ]
+then
+  unset MAVEN_DEPLOY
+fi
+
 #==============================================================================
 # Function definitions
 #==============================================================================
@@ -82,6 +84,8 @@
     maven -Dmaven.final.name=commons-$component-$time_stamp \
     clean dist > $log_location/$component.log 2>&1 
 
+  if [ $DIST_DEPLOY ]
+  then
     # Deploy source and binary distro to commons nightly location
     ssh [EMAIL PROTECTED] mkdir -p $deploy_location/commons-$component
     scp target/distributions/commons-$component*.gz \
@@ -90,10 +94,13 @@
     [EMAIL PROTECTED]:$deploy_location/commons-$component
     scp target/distributions/commons-$component*.md5 \
     [EMAIL PROTECTED]:$deploy_location/commons-$component
+  fi
 
     # Deploy dated jar manually to maven 1 snapshot repo
     if [ -e "target/commons-$component-$time_stamp.jar" ] # build succeeded
     then 
+     if [ $MAVEN_DEPLOY ]
+     then
       echo "Deploying commons-$component SNAPSHOT jar to m1 snapshot repo"
       # Create component directory in the repo if it does not exist
       ssh [EMAIL PROTECTED] mkdir -p 
${maven_snapshot_directory}/commons-$component/jars
@@ -116,6 +123,7 @@
 
       # Make files group writable 
       ssh [EMAIL PROTECTED] chmod -R g+w 
${maven_snapshot_directory}/commons-$component
+     fi
     else # build failed - add to failure list and capture unit test logs
       [EMAIL PROTECTED]
       echo "Test Reports" >> $log_location/$component.log
@@ -151,6 +159,8 @@
     mv target/commons-$component*bin.zip 
target/commons-$component-$time_stamp.zip
     mv target/commons-$component*src.zip 
target/commons-$component-$time_stamp-src.zip
 
+  if [ $DIST_DEPLOY ]
+  then
     # Deploy source and binary distro to commons nightly location
     ssh [EMAIL PROTECTED] mkdir -p $deploy_location/commons-$component
     scp target/commons-$component*.gz \
@@ -159,12 +169,16 @@
     [EMAIL PROTECTED]:$deploy_location/commons-$component
     scp target/commons-$component*.md5 \
     [EMAIL PROTECTED]:$deploy_location/commons-$component
+  fi
 
     # Deploy dated jar to maven 2 snapshot repo (configured in apache pom)
     if [ `ls target/commons-$component*.jar` ] # build succeeded
     then 
+     if [ $MAVEN_DEPLOY ]
+     then
        echo "Deploying commons-$component SNAPSHOT jar to m2 snapshot repo"
        mvn deploy >> $log_location/$component.log 2>&1 
+     fi
     else # build failed - add to failure list and capture unit test logs
       [EMAIL PROTECTED]
       echo "Test Reports" >> $log_location/$component.log
@@ -218,11 +232,14 @@
     zip -q -r commons-${component}-$time_stamp.zip commons-$component
 
     # Upload files
+  if [ $DIST_DEPLOY ] 
+  then
     ssh [EMAIL PROTECTED] mkdir -p $deploy_location/commons-$component
     scp commons-$component*.gz \
     [EMAIL PROTECTED]:$deploy_location/commons-$component
     scp commons-$component*.zip \
     [EMAIL PROTECTED]:$deploy_location/commons-$component
+  fi
 
     # Cleanup
     rm -f commons-$component*.gz
@@ -324,9 +341,14 @@
   for i in "[EMAIL PROTECTED]"; do
     echo "${log_url}/${time_stamp}/${i}.log" >> ${report_location}
   done
+ if [ $DIST_DEPLOY ]
+ then
   scp ${report_location} [EMAIL PROTECTED]:/home/$deploy_user
   ssh [EMAIL PROTECTED] mail -s $subject $notification_email < 
${report_location}
   ssh [EMAIL PROTECTED] rm /home/$deploy_user/build_report 
+ else
+  mail -s $subject $notification_email < ${report_location}
+ fi
   rm ${report_location}
 fi
 

Added: jakarta/commons/proper/commons-build/trunk/vmbuild.conf
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/commons-build/trunk/vmbuild.conf?view=auto&rev=474610
==============================================================================
--- jakarta/commons/proper/commons-build/trunk/vmbuild.conf (added)
+++ jakarta/commons/proper/commons-build/trunk/vmbuild.conf Mon Nov 13 16:46:35 
2006
@@ -0,0 +1,24 @@
+#==============================================================================
+# Configuration
+#==============================================================================
+# Notes: 1) Path specifications are absolute
+#        2) $deploy_user must have an ssh key on the build host that is
+#           authorized on the $deploy_host
+#==============================================================================
+proper_root="/home/psteitz/trunks-proper"     # local commons proper checkout  
 
+sandbox_root="/home/psteitz/trunks-sandbox"   # local sandbox checkout
+deploy_host="people.apache.org"               # deployment host
+deploy_user="psteitz"                         # user on the deployment host
+# path to component lists
+nightly_list_location="${proper_root}/commons-build"  
+# deployment path on $deploy_host
+deploy_location="/x1/www/people.apache.org/builds/jakarta-commons/nightly"   
+log_location="/home/psteitz/log"              # where to put logs
+report_location="/home/psteitz/build_report"
+time_stamp=`date +%Y%m%d`                     # time stamp in file names
+ant_build="/home/psteitz/build"               # Ant build directory
+maven_snapshot_host='people.apache.org'         # Maven snapshot host
+maven_snapshot_user='psteitz'
+maven_snapshot_directory='/www/people.apache.org/repo/m1-snapshot-repository'
+log_url='http://people.apache.org/~psteitz/commons-nightlies'
+notification_email='[email protected]'



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

Reply via email to