Setting tag NodeManager-1.8-21
[build.git] / vbuild-nightly.sh
index 8362abd..c539255 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:.*')
@@ -124,7 +124,7 @@ function failure() {
            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 --lines=1000 ${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.
@@ -222,8 +222,9 @@ function run_log () {
     TESTS_SYSTEM_SVNPATH=${TESTS_SVNPATH}/system
 
     ### the URL to the RPMS/<arch> location
+    # f12 now has everything in i686; try i386 first as older fedoras have both
     url=""
-    for a in i386 x86_64; do
+    for a in i386 i686 x86_64; do
        archdir=/vservers/$BASE/build/RPMS/$a
        if [ -d $archdir ] ; then
            # where was that installed
@@ -258,7 +259,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 +442,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 ;;
@@ -536,15 +537,20 @@ function main () {
            vserver ${BASE} exec svn update /build
            # get environment from the first run 
            FCDISTRO=$(vserver ${BASE} exec /build/getdistroname.sh)
-
-           PLDISTRO=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +PLDISTRO)
-           PLDISTROTAGS=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +PLDISTROTAGS)
-           build_SVNPATH=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +build-SVNPATH)
-           PERSONALITY=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +PERSONALITY)
-           MAILTO=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +MAILTO)
-           WEBPATH=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +WEBPATH)
-           TESTBUILDURL=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +TESTBUILDURL)
-           WEBROOT=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +WEBROOT)
+           # retrieve all in one run
+           tmp=/tmp/${BASE}-env.sh
+           vserver ${BASE} exec make --no-print-directory -C /build stage1=skip \
+               ++PLDISTRO ++PLDISTROTAGS ++PERSONALITY ++MAILTO ++WEBPATH ++TESTBUILDURL ++WEBROOT > $tmp
+           # sh vars cannot have a minus
+           echo build_SVNPATH=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +build-SVNPATH) >> $tmp
+           . $tmp
+           rm -f $tmp
+           options=(${options[@]} -d $PLDISTRO -t $PLDISTROTAGS -s $build_SVNPATH)
+           [ -n "$PERSONALITY" ] && options=(${options[@]} -p $PERSONALITY)
+           [ -n "$MAILTO" ] && options=(${options[@]} -m $MAILTO)
+           [ -n "$WEBPATH" ] && options=(${options[@]} -w $WEBPATH)
+           [ -n "$TESTBUILDURL" ] && options=(${options[@]} -W $TESTBUILDURL)
+           [ -n "$WEBROOT" ] && options=(${options[@]} -r $WEBROOT)
            show_env
        else
            # create vserver: check it does not exist yet
@@ -573,7 +579,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 +624,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