X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=vbuild-nightly.sh;h=1207487043343a9e76ee45f33670c23dbe54b30f;hb=ba5cc6adfbad0582d3462b897ddc99ab253a0c37;hp=07353cd9570bd62c426fdc0f9b907bfb5b7f81cb;hpb=3ba366f095c2d2eaa6ada3ce45f066f6dafbf198;p=build.git diff --git a/vbuild-nightly.sh b/vbuild-nightly.sh index 07353cd9..12074870 100755 --- a/vbuild-nightly.sh +++ b/vbuild-nightly.sh @@ -11,8 +11,7 @@ DEFAULT_PERSONALITY=linux32 DEFAULT_BASE="@DATE@--@PLDISTRO@-@FCDISTRO@-@PERSONALITY@" DEFAULT_SVNPATH="http://svn.planet-lab.org/svn/build/trunk" DEFAULT_TESTSVNPATH="http://svn.planet-lab.org/svn/tests/trunk/system/" -DEFAULT_TESTCONFIG32="main 1vnodes 1testbox32" -DEFAULT_TESTCONFIG64="main 1vnodes 1testbox64" +DEFAULT_TESTCONFIG="default" DEFAULT_IFNAME=eth0 # web publishing results @@ -99,9 +98,9 @@ function failure() { mkdir -p ${WEBPATH} cp $LOG ${WEBLOG} summary $LOG >> ${WEBLOG} - (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 20k $WEBLOG) > ${WEBLOG}.ko + (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 30k $WEBLOG) > ${WEBLOG}.ko if [ -n "$MAILTO" ] ; then - tail -c 20k ${WEBLOG} | mail -s "Failures for build ${BASE}" $MAILTO + tail -c 30k ${WEBLOG} | mail -s "Failures for build ${BASE}" $MAILTO fi exit 1 } @@ -112,7 +111,12 @@ function success () { mkdir -p ${WEBPATH} cp $LOG ${WEBLOG} summary $LOG >> ${WEBLOG} - touch ${WEBLOG}.ok + if [ -n "$DO_TEST" ] ; then + echo "Successfully built and tested - see testlogs for details" > ${WEBLOG}.pass + rm -f ${WEBLOG}.ok + else + echo "Successfully built"> ${WEBLOG}.ok + fi if [ -n "$MAILTO" ] ; then (echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ) | mail -s "Successful build for ${BASE}" $MAILTO fi @@ -170,10 +174,8 @@ function runtest () { fi url=$(echo $rpm | sed -e "s,/vservers/$BASE/build,${TESTBUILDURL}${PLDISTRO}/${BASE},") - # compute test directory name on test box - testdir=chroot-${BASE} - # use another name if any config contains vserver - echo $TESTCONFIG | grep vserver &> /dev/null && testdir=vserver-${BASE} + # test directory name on test box + testdir=${BASE} # clean it ssh ${TESTBOXSSH} rm -rf ${testdir} # check it out @@ -183,9 +185,19 @@ function runtest () { for config in ${TESTCONFIG} ; do configs="$configs --config $config" done - ssh 2>&1 ${TESTBOXSSH} python -u ${testdir}/runtest --build ${SVNPATH} --url ${url} $configs --all - - if [ "$?" != 0 ] ; then + + # need to proceed despite of set -e + success=true + ssh 2>&1 ${TESTBOXSSH} ${testdir}/runtest --build ${SVNPATH} --url ${url} $configs --all || success= + + # gather logs in the vserver + mkdir -p /vservers/$BASE/build/testlogs + ssh 2>&1 ${TESTBOXSSH} tar -C ${testdir}/logs -cf - . | tar -C /vservers/$BASE/build/testlogs -xf - || true + # push them to the build web + rsync --archive --delete /vservers/$BASE/build/testlogs/ $WEBPATH/$BASE/testlogs/ + chmod -R a+r $WEBPATH/$BASE/testlogs/ + + if [ -z "$success" ] ; then failure fi @@ -227,7 +239,7 @@ function usage () { echo " -r tagsrelease - a release number that refers to PLDISTROTAGS - defaults to HEAD" echo " -s svnpath - where to fetch the build module" echo " -x testsvnpath - defaults to $DEFAULT_TESTSVNPATH" - echo " -c testconfig - defaults to $DEFAULT_TESTCONFIG32 or $DEFAULT_TESTCONFIG64" + echo " -c testconfig - defaults to $DEFAULT_TESTCONFIG" echo " -w webpath - defaults to $DEFAULT_WEBPATH" echo " -m mailto - no default" echo " -O : overwrite - re-run in base directory, do not re-create vserver" @@ -292,8 +304,7 @@ function main () { [ -z "$IFNAME" ] && IFNAME="$DEFAULT_IFNAME" [ -z "$SVNPATH" ] && SVNPATH="$DEFAULT_SVNPATH" [ -z "$TESTSVNPATH" ] && TESTSVNPATH="$DEFAULT_TESTSVNPATH" - [ "$PERSONALITY" == linux32 ] && [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG32" - [ "$PERSONALITY" == linux64 ] && [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG64" + [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG" [ -n "$DRY_RUN" ] && MAILTO="" @@ -328,6 +339,8 @@ function main () { set -x echo "XXXXXXXXXX $COMMAND: using existing vserver $BASE" $(date) show_env + # start in case e.g. we just rebooted + vserver ${BASE} start || : # update build vserver ${BASE} exec svn update /build else @@ -391,6 +404,8 @@ function main () { rm -rf $WEBPATH/$BASE ; mkdir -p $WEBPATH/$BASE/{RPMS,SRPMS} rsync --archive --delete --verbose /vservers/$BASE/build/RPMS/ $WEBPATH/$BASE/RPMS/ rsync --archive --delete --verbose /vservers/$BASE/build/SRPMS/ $WEBPATH/$BASE/SRPMS/ + # publish myplc-release + rsync --verbose /vservers/$BASE/build/myplc-release $WEBPATH/$BASE if [ -n "$DO_TEST" ] ; then runtest