X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvbuild-nightly.sh;h=92f56397b362ea5146232685bc804b006e9158be;hb=869b1cfb57831a9463b04ccf34d9a5d537d5ee87;hp=aabceb950b9f042bd44b4a944c6d6c489e743a25;hpb=73289292d2247da932a7d0c0c1a77e1dc2a23e8b;p=infrastructure.git diff --git a/scripts/vbuild-nightly.sh b/scripts/vbuild-nightly.sh index aabceb9..92f5639 100755 --- a/scripts/vbuild-nightly.sh +++ b/scripts/vbuild-nightly.sh @@ -1,22 +1,27 @@ #!/bin/bash -REVISION=$(echo '$Revision: 1053 $' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' ) COMMAND=$(basename $0) -SVNPATH="http://svn.planet-lab.org/svn/build/trunk" +BUILD_SCM_URL="git://git.onelab.eu/build" -# scan args for any -s option, and SVNPATH in this case -function scan_svnpath () { +# scan args for any -s option, and set BUILD_SCM_URL in this case +function scan_build_scm_url () { while [[ -n "$@" ]] ; do if [ "$1" == "-s" ] ; then - SVNPATH="$2" + BUILD_SCM_URL="$2" fi shift done + + GIT_REPO=$(echo $BUILD_SCM_URL | cut -d@ -f1) + GIT_TAG=$(echo $BUILD_SCM_URL | cut -s -d@ -f2) + GIT_TAG=${GIT_TAG:-master} } -scan_svnpath "$@" +scan_build_scm_url "$@" -tmp=/tmp/$COMMAND-$$ -svn cat $SVNPATH/$COMMAND > $tmp -chmod +x $tmp -$tmp "$@" -rm $tmp +tmpd=/tmp/git-$$ +tmpc=$tpmd/$COMMAND +mkdir $tmpd +git archive --remote=$GIT_REPO $GIT_TAG $COMMAND | tar -C $tmpd -xf - +chmod +x $tmc +$tmpc "$@" +rm -rf $tmpd