X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvbuild-nightly.sh;h=014ec19e7ffa3d9d474a350441f297c6e9568ae0;hb=0827cda25b6fcf9810d83691c4c272cf7c606dcf;hp=aabceb950b9f042bd44b4a944c6d6c489e743a25;hpb=73289292d2247da932a7d0c0c1a77e1dc2a23e8b;p=infrastructure.git diff --git a/scripts/vbuild-nightly.sh b/scripts/vbuild-nightly.sh index aabceb9..014ec19 100755 --- a/scripts/vbuild-nightly.sh +++ b/scripts/vbuild-nightly.sh @@ -1,22 +1,36 @@ #!/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" +USE_GIT="" -# 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 + + # is this a git url ? + if echo $BUILD_SCM_URL | grep -q git ; then USE_GIT="true" ; fi + + if [ -n "$USE_GIT" ] ; then + GIT_REPO=$(echo $BUILD_SCM_URL | cut -d@ -f1) + GIT_TAG=$(echo $BUILD_SCM_URL | cut -s -d@ -f2) + GIT_TAG=${GIT_TAG:-master} + fi } -scan_svnpath "$@" +scan_build_scm_url "$@" tmp=/tmp/$COMMAND-$$ -svn cat $SVNPATH/$COMMAND > $tmp +if [ -n "$USE_GIT" ] ; then + git archive --remote=$GIT_REPO $GIT_TAG $COMMAND | tar -C /tmp -xf - + mv /tmp/$COMMAND $tmp +else + svn cat $BUILD_SCM_URL/$COMMAND > $tmp +fi chmod +x $tmp $tmp "$@" rm $tmp