X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vbuild-nightly.sh;h=5ee38d9a3f386f46d7548218c493168f74b2722f;hb=107e45ff26756558dd53a5ad95811bd4856d85b6;hp=08843d3adb9aaa2bf0a1a8c2722fcefd9bd894f7;hpb=71ccfeb2b514ee738f1b95b0dccb9fd05a1a2de6;p=build.git diff --git a/vbuild-nightly.sh b/vbuild-nightly.sh index 08843d3a..5ee38d9a 100755 --- a/vbuild-nightly.sh +++ b/vbuild-nightly.sh @@ -1,5 +1,5 @@ #!/bin/bash -REVISION=$(echo '$Revision: 18119 $' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' ) +REVISION=$(echo '$Revision: 18120 $' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' ) COMMANDPATH=$0 COMMAND=$(basename $0) @@ -9,7 +9,7 @@ DEFAULT_FCDISTRO=centos5 DEFAULT_PLDISTRO=planetlab DEFAULT_PERSONALITY=linux32 DEFAULT_BASE="@DATE@--@PLDISTRO@-@FCDISTRO@-@PERSONALITY@" -DEFAULT_BUILD_SCM_URL="http://svn.planet-lab.org/svn/build/trunk" +DEFAULT_BUILD_SCM_URL="git://git.onelab.eu/build" DEFAULT_IFNAME=eth0 # default gpg path used in signing yum repo @@ -121,7 +121,7 @@ function webpublish_append_stdin_to_file () { ssh root@${WEBHOST} cat \>\> $1; } function failure() { set -x # early stage ? - let's not create /build/@PLDISTRO@ - if webpublish_misses_dir $WEBPATH ; then + if test -z "$WEBLOG" ; then WEBHOST=localhost WEBPATH=/tmp WEBBASE=/tmp/vbuild-early-$(date +%Y-%m-%d) @@ -149,7 +149,7 @@ function failure() { function success () { set -x # early stage ? - let's not create /build/@PLDISTRO@ - if webpublish_misses_dir ${WEBPATH} ; then + if test -z "$WEBLOG" ; then WEBHOST=localhost WEBPATH=/tmp WEBLOG=/tmp/vbuild-early-$(date +%Y-%m-%d).log.txt @@ -560,25 +560,24 @@ function main () { echo "XXXXXXXXXX $COMMAND: using existing vserver $BASE" $(date) # start in case e.g. we just rebooted vserver ${BASE} start || : + # retrieve environment from the previous run + FCDISTRO=$(vserver ${BASE} exec /build/getdistroname.sh) + BUILD_SCM_URL=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +build-SVNPATH +build-GITPATH) + # for efficiency, crop everything in one make 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 + . $tmp + rm -f $tmp # update build [ -n "$SSH_KEY" ] && setupssh ${BASE} ${SSH_KEY} if echo $BUILD_SCM_URL | grep -q git ; then - vserver $BASE exec bash -c "cd /build; git pull" + vserver $BASE exec bash -c "cd /build; git pull; make tests-clean" else vserver $BASE exec svn update /build fi # make sure we refresh the tests place in case it has changed rm -f /build/MODULES/tests - # get environment from the first run - FCDISTRO=$(vserver ${BASE} exec /build/getdistroname.sh) - # 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_SCM_URL=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +build-SVNPATH +build-GITPATH) >> $tmp - . $tmp - rm -f $tmp options=(${options[@]} -d $PLDISTRO -t $PLDISTROTAGS -s $BUILD_SCM_URL) [ -n "$PERSONALITY" ] && options=(${options[@]} -p $PERSONALITY) [ -n "$MAILTO" ] && options=(${options[@]} -m $MAILTO) @@ -627,7 +626,7 @@ function main () { # Extract build again - in the vserver [ -n "$SSH_KEY" ] && setupssh ${BASE} ${SSH_KEY} if echo $BUILD_SCM_URL | grep -q git ; then - vserver $BASE exce bash -c "mkdir /build ; git archive --remote=$GIT_REPO $GIT_TAG | tar -C /build -xf -" + vserver $BASE exec bash -c "git clone $GIT_REPO /build; cd /build; git checkout $GIT_TAG" else vserver $BASE exec svn checkout ${BUILD_SCM_URL} /build fi