Tagging module BootstrapFS - BootstrapFS-1.0-0
[build.git] / vbuild-nightly.sh
index 5930019..a50b9ac 100755 (executable)
@@ -18,8 +18,7 @@ DEFAULT_WEBPATH="/build/@PLDISTRO@/"
 
 # for the test part
 TESTBUILDURL="http://build.one-lab.org/"
-TESTBOX=onelab-test.inria.fr
-TESTBOXSSH=root@onelab-test.inria.fr
+TESTBOXSSH=root@testbox1.one-lab.org
 ####################
 # assuming vserver runs in UTC
 DATE=$(date +'%Y.%m.%d')
@@ -189,13 +188,13 @@ function runtest () {
     echo -n "============================== Starting $COMMAND:runtest on $(date)"
 
     ### the URL to the myplc package
-    rpm=$( (cd /vservers/$BASE/build/RPMS/i386 ; ls myplc-[0-9]*.rpm) )
+    rpm=$( find /vservers/$BASE/build/RPMS -name 'myplc-[0-9]*' )
     if [ ${#rpm[@]} != 1 ] ; then
        echo "$COMMAND: Cannot locate rpm for testing"
        failure
        exit 1
     fi
-    url=${TESTBUILDURL}${PLDISTRO}/${BASE}/RPMS/i386/${rpm}
+    url=$(echo $rpm | sed -e "s,/vservers/$BASE/build,${TESTBUILDURL}${PLDISTRO}/${BASE},")
 
     # compute test directory name on test box
     testdir=test-${BASE}
@@ -265,10 +264,6 @@ function main () {
 
     set -e
 
-    # preserve arguments for passing them again later
-    declare -a argv
-    for arg in "$@"; do argv=(${argv[@]} "$arg") ; done
-    
     # parse arguments
     MAKEVARS=()
     DRY_RUN=
@@ -298,7 +293,11 @@ function main () {
        esac
     done
        
-    shift $(($OPTIND - 1))
+    # preserve options for passing them again later, together with expanded base
+    declare -a options
+    toshift=$(($OPTIND - 1))
+    arg=1; while [ $arg -le $toshift ] ; do options=(${options[@]} "$1") ; shift; arg=$(($arg+1)) ; done
+
     MAKETARGETS="$@"
     
     # set defaults
@@ -402,7 +401,7 @@ function main () {
 
            # invoke this command in the vserver for building (-T)
            vserver ${BASE} exec chmod +x /build/$COMMAND
-           vserver ${BASE} exec /build/$COMMAND "${argv[@]}" -b "${BASE}"
+           vserver ${BASE} exec /build/$COMMAND "${options[@]}" -b "${BASE}" $MAKETARGETS
        fi
 
        # publish to the web so runtest can find them