Author: nigel Date: Wed Jan 9 15:26:10 2008 New Revision: 610610 URL: http://svn.apache.org/viewvc?rev=610610&view=rev Log: add support for enforcing a patch queue, adding visibility to the queue, and using svn update for patch checkouts
Added: lucene/hadoop/nightly/hudsonPatchQueueAdmin.sh (with props) Modified: lucene/hadoop/nightly/hudsonBuildHadoopPatch.sh lucene/hadoop/nightly/processHadoopPatchEmail.sh Modified: lucene/hadoop/nightly/hudsonBuildHadoopPatch.sh URL: http://svn.apache.org/viewvc/lucene/hadoop/nightly/hudsonBuildHadoopPatch.sh?rev=610610&r1=610609&r2=610610&view=diff ============================================================================== --- lucene/hadoop/nightly/hudsonBuildHadoopPatch.sh (original) +++ lucene/hadoop/nightly/hudsonBuildHadoopPatch.sh Wed Jan 9 15:26:10 2008 @@ -4,6 +4,7 @@ ### Setup some variables. BUILD_ID is set by Hudson baseDir=/export/home/hudson/hudson/jobs/Hadoop-Patch +SVN=/usr/local/bin/svn GREP=/usr/local/bin/grep WGET=/usr/sfw/bin/wget PATCH=/usr/local/bin/patch @@ -13,7 +14,7 @@ FORREST_HOME=$HUDSON_HOME/../tools/forrest/latest ############################################################################### -setup () { +checkout () { echo "" echo "" echo "======================================================================" @@ -23,7 +24,22 @@ echo "======================================================================" echo "" echo "" + if [[ -d $baseDir/workspace/trunk ]] ; then + cd $baseDir/workspace/trunk + $SVN revert -R . + rm -rf `$SVN status` + $SVN update + else + cd $baseDir/workspace/ + $SVN co http://svn.apache.org/repos/asf/lucene/hadoop/trunk + fi + echo "" + echo "" + return ? +} +############################################################################### +setup () { ### Download latest patch file (ignoring .htm and .html) $WGET -q -O $baseDir/current/jira http://issues.apache.org/jira/browse/$defect if [[ `$GREP -c 'Patch Available' $baseDir/current/jira` == 0 ]] ; then Added: lucene/hadoop/nightly/hudsonPatchQueueAdmin.sh URL: http://svn.apache.org/viewvc/lucene/hadoop/nightly/hudsonPatchQueueAdmin.sh?rev=610610&view=auto ============================================================================== --- lucene/hadoop/nightly/hudsonPatchQueueAdmin.sh (added) +++ lucene/hadoop/nightly/hudsonPatchQueueAdmin.sh Wed Jan 9 15:26:10 2008 @@ -0,0 +1,53 @@ +#!/bin/bash + +#set -x + +LOG=HadoopPatchQueue.txt +CURRENT_LINK=../patches/current +START_PWD=`pwd` + +CURRENT_PATCH=`cat $CURRENT_LINK/defectNum` +if [[ $CURRENT_PATCH == "" ]] ; then + cd ../patches + CURRENT_PATCH=`ls -1dt HADOOP* | tail -1` + cd $START_PWD + if [[ $CURRENT_PATCH != "" ]] ; then + rm $CURRENT_LINK + ln -s $CURRENT_PATCH $CURRENT_LINK + ### Start build. The 'token' is a secret. + echo "$CURRENT_PATCH patch submitted for testing at `date`" + token=`cat ~hudson/private/hudsonBuildToken` + /usr/sfw/bin/wget -q -O $CURRENT_LINK/build http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/build?token=$token + chmod -R g+w $CURRENT_LINK + else + CURRENT_PATCH="<none>" + fi +fi + +cd ../patches +QUEUE=`ls -1dtr HADOOP* | sed -e "s|$CURRENT_PATCH\n||"` +cd $START_PWD +if [[ $QUEUE == "" ]] ; then + QUEUE="<empty>" +fi + +echo "" > $LOG +echo `date` >>$LOG +echo "" >> $LOG +echo "===================================" >> $LOG +echo "CURRENTLY RUNNING OR WAITING TO RUN" >> $LOG +echo "===================================" >> $LOG +echo "" >> $LOG +echo "$CURRENT_PATCH" >> $LOG +echo "" >> $LOG + +echo "" >> $LOG +echo "==================" >> $LOG +echo "HADOOP PATCH QUEUE" >> $LOG +echo "==================" >> $LOG +echo "" >> $LOG +echo " Head of Queue" >> $LOG +echo "$QUEUE" >> $LOG +echo " Tail of Queue" >> $LOG +echo "" >> $LOG + Propchange: lucene/hadoop/nightly/hudsonPatchQueueAdmin.sh ------------------------------------------------------------------------------ svn:executable = * Modified: lucene/hadoop/nightly/processHadoopPatchEmail.sh URL: http://svn.apache.org/viewvc/lucene/hadoop/nightly/processHadoopPatchEmail.sh?rev=610610&r1=610609&r2=610610&view=diff ============================================================================== --- lucene/hadoop/nightly/processHadoopPatchEmail.sh (original) +++ lucene/hadoop/nightly/processHadoopPatchEmail.sh Wed Jan 9 15:26:10 2008 @@ -37,25 +37,5 @@ ### Since this script is run by the 'daemon' user by sendmail, ### make sure everything it creates is group writable chmod -R g+w $baseDir/$defect - - ### Wait here until the current build is complete. - ### The 'current' link provides a locking mechanism - ### between this script and the buildTest.sh script. - while [[ -L $baseDir/current ]] ; do - sleep 59 - done - - ### check to make sure the defect dir still exists; this allows - ### an admin to delete the directory and bypass the testing - if [[ -d $baseDir/$defect ]] ; then - ### Create the 'current' link to this build - ln -s $baseDir/$defect $baseDir/current - - ### Start build. The 'token' is a secret. - echo "$defect patch submitted for testing at `date`" >> $LOG - token=`cat ~hudson/private/hudsonBuildToken` - /usr/sfw/bin/wget -q -O $baseDir/$defect/build http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/build?token=$token - chmod -R g+w $baseDir/$defect - fi fi exit 0