build monitor
[build.git] / vbuild-nightly.sh
index 69eb803..d33d83c 100755 (executable)
@@ -52,7 +52,7 @@ function summary () {
 # read a full log and tries to extract the interesting stuff
 
 import sys,re
-m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*|.*is not installed.*|.*PROPFIND.*|.*Starting.*:run_log.*")
+m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*| \* .*|.*is not installed.*|.*PROPFIND.*|.*Starting.*:run_log.*")
 m_installing_any=re.compile('\r  (Installing:[^\]]*]) ')
 m_installing_err=re.compile('\r  (Installing:[^\]]*])(..+)')
 m_installing_end=re.compile('Installed:.*')
@@ -118,13 +118,13 @@ function failure() {
     fi
     cp $LOG ${WEBLOG}
     summary $LOG >> ${WEBLOG}
-    (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 30k $WEBLOG) > ${WEBLOG}.ko
+    (echo -n "============================== $COMMAND: failure at " ; date ; tail --lines=1000 $WEBLOG) > ${WEBLOG}.ko
     if [ -n "$MAILTO" ] ; then
        ( \
            echo "See full build log at ${LOG_URL}" ; \
            echo "and tail version at ${LOG_URL}.ko" ; \
            echo "See complete set of testlogs at ${TESTLOGS_URL}" ; \
-           tail -c 30k ${WEBLOG} ) | mail -s "Failures with ${MAIL_SUBJECT} ${BASE}" $MAILTO
+           tail --lines=1000 ${WEBLOG} ) | mail -s "Failures with ${MAIL_SUBJECT} ${BASE} on $(hostname)" $MAILTO
     fi
     exit 1
 }
@@ -157,7 +157,7 @@ function success () {
            echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ; \
            echo "See full build log at ${LOG_URL}" ; \
             [ -n "$DO_TEST" ] && echo "See complete set of testlogs at ${TESTLOGS_URL}" ) \
-           | mail -s "Success with ${MAIL_SUBJECT} ${BASE}" $MAILTO
+           | mail -s "Success with ${MAIL_SUBJECT} ${BASE} on $(hostname)" $MAILTO
     fi
     # XXX For some reason, we haven't been getting this email for successful builds. If this sleep
     # doesn't fix the problem, I'll remove it -- Sapan.
@@ -258,7 +258,7 @@ function run_log () {
 
     # need to proceed despite of set -e
     success=true
-    ssh 2>&1 -n ${testmaster_ssh} ${testdir}/run_log --build ${build_SVNPATH} --url ${url} $configs $test_env --verbose --all || success=
+    ssh 2>&1 -n ${testmaster_ssh} ${testdir}/run_log --build ${build_SVNPATH} --url ${url} $configs $test_env $VERBOSE --all || success=
 
     # gather logs in the vserver
     mkdir -p /vservers/$BASE/build/testlogs
@@ -441,7 +441,7 @@ function main () {
            B) DO_TEST= ;;
            T) DO_BUILD= ;;
            n) DRY_RUN="-n" ;;
-           v) set -x ;;
+           v) set -x ; VERBOSE="-v" ;;
            7) BASE="$(date +%a|tr A-Z a-z)-@FCDISTRO@" ;;
            i) IFNAME=$OPTARG ;;
            h|*) usage ;;
@@ -573,7 +573,7 @@ function main () {
            svn export $build_SVNPATH $tmpdir
             # Create vserver
            cd $tmpdir
-           ./vbuild-init-vserver.sh -f ${FCDISTRO} -d ${PLDISTRO} -p ${PERSONALITY} -i ${IFNAME} ${BASE} 
+           ./vbuild-init-vserver.sh $VERBOSE -f ${FCDISTRO} -d ${PLDISTRO} -p ${PERSONALITY} -i ${IFNAME} ${BASE} 
            # cleanup
            cd -
            rm -rf $tmpdir
@@ -618,11 +618,11 @@ function main () {
 
        # publish to the web so run_log can find them
        rm -rf $WEBPATH/$BASE ; mkdir -p $WEBPATH/$BASE/{RPMS,SRPMS}
-       rsync --archive --delete --verbose /vservers/$BASE/build/RPMS/ $WEBPATH/$BASE/RPMS/
-       [[ -n "$PUBLISH_SRPMS" ]] && rsync --archive --delete --verbose /vservers/$BASE/build/SRPMS/ $WEBPATH/$BASE/SRPMS/
+       rsync --archive --delete $VERBOSE /vservers/$BASE/build/RPMS/ $WEBPATH/$BASE/RPMS/
+       [[ -n "$PUBLISH_SRPMS" ]] && rsync --archive --delete $VERBOSE /vservers/$BASE/build/SRPMS/ $WEBPATH/$BASE/SRPMS/
        # publish myplc-release if this exists
        release=/vservers/$BASE/build/myplc-release
-       [ -f $release ] && rsync --verbose $release $WEBPATH/$BASE
+       [ -f $release ] && rsync $VERBOSE $release $WEBPATH/$BASE
 
         # create yum repo and sign packages.
        if [ -n "$SIGNYUMREPO" ] ; then