X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vbuild-nightly.sh;h=0516c1b420404c0e473892945c98c0bf425cbcaa;hb=63a4f22ce2eb45f22cb27f35ccff7026284d8351;hp=367bc2401cd01744f1b14815b4b5ee13f1c03ac9;hpb=5cea1d1820205ca3b6c11d98a9d9d6a2bfaa99f8;p=build.git diff --git a/vbuild-nightly.sh b/vbuild-nightly.sh index 367bc240..0516c1b4 100755 --- a/vbuild-nightly.sh +++ b/vbuild-nightly.sh @@ -39,7 +39,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.*") +m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*|.*is not installed.*|.*PROPFIND.*|.*Starting.*:runtest.*") m_installing_any=re.compile('\r (Installing:[^\]]*]) ') m_installing_err=re.compile('\r (Installing:[^\]]*])(..+)') m_installing_end=re.compile('Installed:.*') @@ -98,7 +98,11 @@ EOF # Notify recipient of failure or success, manage various stamps function failure() { set -x - mkdir -p ${WEBPATH} + # early stage ? - let's not create /build/@PLDISTRO@ + if [ ! -d ${WEBPATH} ] ; then + WEBPATH=/tmp + WEBLOG=/tmp/vbuild-early.log.txt + fi cp $LOG ${WEBLOG} summary $LOG >> ${WEBLOG} (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 30k $WEBLOG) > ${WEBLOG}.ko @@ -107,14 +111,18 @@ 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 -c 30k ${WEBLOG} ) | mail -s "Failures for build ${BASE}" $MAILTO + tail -c 30k ${WEBLOG} ) | mail -s "Failures with ${MAIL_SUBJECT}" $MAILTO fi exit 1 } function success () { set -x - mkdir -p ${WEBPATH} + # early stage ? - let's not create /build/@PLDISTRO@ + if [ ! -d ${WEBPATH} ] ; then + WEBPATH=/tmp + WEBLOG=/tmp/vbuild-early-$(date +%Y-%m-%d).log.txt + fi cp $LOG ${WEBLOG} summary $LOG >> ${WEBLOG} if [ -n "$DO_TEST" ] ; then @@ -123,19 +131,20 @@ function success () { echo "See full build log at ${LOG_URL}" ; \ echo "See complete set of testlogs at ${TESTLOGS_URL}" ; \ ) > ${WEBLOG}.pass - rm -f ${WEBLOG}.ok ${WEBLOG}.ko + rm -f ${WEBLOG}.pkg-ok ${WEBLOG}.ko else ( \ - echo "Successfully built, no test requested" ; \ + echo "Successful package-only build, no test requested" ; \ echo "See full build log at ${LOG_URL}" ; \ - ) > ${WEBLOG}.ok + ) > ${WEBLOG}.pkg-ok + rm -f ${WEBLOG}.ko fi if [ -n "$MAILTO" ] ; then ( \ 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 "Successful build for ${BASE}" $MAILTO + | mail -s "Success with ${MAIL_SUBJECT}" $MAILTO fi exit 0 } @@ -149,11 +158,6 @@ function build () { date cd /build - # if TAGSRELEASE specified : update PLDISTROTAGS with this tag - if [ -n "$TAGSRELEASE" ] ; then - svn up -r $TAGSRELEASE $PLDISTROTAGS - fi - show_env echo "Running make IN $(pwd)" @@ -239,8 +243,8 @@ function runtest () { mkdir -p /vservers/$BASE/build/testlogs ssh 2>&1 -n ${TESTBOXSSH} tar -C ${testdir}/logs -cf - . | tar -C /vservers/$BASE/build/testlogs -xf - || true # push them to the build web + chmod -R a+r /vservers/$BASE/build/testlogs/ rsync --archive --delete /vservers/$BASE/build/testlogs/ $WEBPATH/$BASE/testlogs/ - chmod -R a+r $WEBPATH/$BASE/testlogs/ if [ -z "$success" ] ; then failure @@ -253,6 +257,7 @@ function in_root_context () { rpm -q util-vserver > /dev/null } +# this part won't work with a remote(rsync) WEBPATH function sign_node_packages () { echo "Signing node packages" @@ -311,16 +316,19 @@ function show_env () { echo MAKEVARS="${MAKEVARS[@]}" echo DRY_RUN="$DRY_RUN" echo PLDISTROTAGS="$PLDISTROTAGS" - echo TAGSRELEASE="$TAGSRELEASE" # this does not help, it's not yet set when we run show_env #echo WEBPATH="$WEBPATH" echo TESTBUILDURL="$TESTBUILDURL" if in_root_context ; then echo PLDISTROTAGS="$PLDISTROTAGS" else - echo "XXXXXXXXXXXXXXXXXXXX Contents of tags definition file /build/$PLDISTROTAGS" - cat /build/$PLDISTROTAGS - echo "XXXXXXXXXXXXXXXXXXXX end tags definition" + if [ -f /build/$PLDISTROTAGS ] ; then + echo "XXXXXXXXXXXXXXXXXXXX Contents of tags definition file /build/$PLDISTROTAGS" + cat /build/$PLDISTROTAGS + echo "XXXXXXXXXXXXXXXXXXXX end tags definition" + else + echo "XXXXXXXXXXXXXXXXXXXX Cannot find tags definition file /build/$PLDISTROTAGS, assuming remote pldistro" + fi fi set -x } @@ -337,7 +345,6 @@ function usage () { echo " -o base: (overwrite) do not re-create vserver, re-use base instead" echo " the -f/-d/-t/-s/-p/-m options are uneffective in this case" echo " -t pldistrotags - defaults to \${PLDISTRO}-tags.mk" - echo " -r tagsrelease - a release number that refers to PLDISTROTAGS - defaults to HEAD" echo " -s svnpath - where to fetch the build module - defaults to $DEFAULT_build_SVNPATH" echo " -c testconfig - defaults to $DEFAULT_TESTCONFIG" echo " -w webpath - defaults to $DEFAULT_WEBPATH" @@ -366,7 +373,7 @@ function main () { DO_BUILD=true DO_TEST=true SIGNYUMREPO="" - while getopts "f:d:p:b:o:t:r:s:x:c:w:W:g:u:m:BTnyv7i:" opt ; do + while getopts "f:d:p:b:o:t:s:x:c:w:W:g:u:m:BTnyv7i:" opt ; do case $opt in f) FCDISTRO=$OPTARG ;; d) PLDISTRO=$OPTARG ;; @@ -374,7 +381,6 @@ function main () { b) BASE=$OPTARG ;; o) OVERBASE=$OPTARG ;; t) PLDISTROTAGS=$OPTARG ;; - r) TAGSRELEASE=$OPTARG ;; s) build_SVNPATH=$OPTARG ;; c) TESTCONFIG="$TESTCONFIG $OPTARG" ;; w) WEBPATH=$OPTARG ;; @@ -426,12 +432,28 @@ function main () { [ -n "$DRY_RUN" ] && MAILTO="" if [ -n "$OVERBASE" ] ; then - BASE=${OVERBASE} + sedargs="-e s,@DATE@,${DATE},g" + BASE=$(echo ${OVERBASE} | sed $sedargs) else sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g" BASE=$(echo ${BASE} | sed $sedargs) fi + ### elaborate mail subject + if [ -n "$DO_BUILD" -a -n "$DO_TEST" ] ; then + MAIL_SUBJECT="complete" + elif [ -n "$DO_BUILD" ] ; then + MAIL_SUBJECT="package-only" + elif [ -n "$DO_TEST" ] ; then + MAIL_SUBJECT="test-only" + fi + if [ -n "$OVERBASE" ] ; then + MAIL_SUBJECT="$MAIL_SUBJECT incremental run on" + else + MAIL_SUBJECT="$MAIL_SUBJECT fresh build" + fi + MAIL_SUBJECT="$MAIL_SUBJECT ${BASE}" + if ! in_root_context ; then # in the vserver echo "==================== Within vserver BEG $(date)" @@ -464,11 +486,11 @@ function main () { # get environment from the first run FCDISTRO=$(vserver ${BASE} exec /build/getdistroname.sh) - PLDISTRO=$(vserver ${BASE} exec make --no-print-directory -C /build +PLDISTRO) - PLDISTROTAGS=$(vserver ${BASE} exec make --no-print-directory -C /build +PLDISTROTAGS) - build_SVNPATH=$(vserver ${BASE} exec make --no-print-directory -C /build +build-SVNPATH) - PERSONALITY=$(vserver ${BASE} exec make --no-print-directory -C /build +PERSONALITY) - MAILTO=$(vserver ${BASE} exec make --no-print-directory -C /build +MAILTO) + 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) show_env else # create vserver: check it does not exist yet @@ -520,6 +542,7 @@ function main () { sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g" WEBPATH=$(echo ${WEBPATH} | sed $sedargs) + mkdir -p ${WEBPATH} # where to store the log for web access WEBLOG=${WEBPATH}/${BASE}.log.txt