changing the plan - runtest gets invoked from root ctx
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 12 Nov 2007 14:26:20 +0000 (14:26 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 12 Nov 2007 14:26:20 +0000 (14:26 +0000)
scripts/nightly-build-vserver.sh

index 0e64f1d..39797bf 100755 (executable)
@@ -77,6 +77,8 @@ function build () {
     set +x
 }
 
+# this was formerly run in the myplc-devel chroot but now is run in the root context,
+# this is so that the .ssh config gets done manually, and once and for all
 function runtest () {
     set -x
     set -e
@@ -86,26 +88,31 @@ function runtest () {
     date
     
     ### the URL to the myplc package
-    cd /build/RPMS/i386
+    cd /vservers/$BASE/build/RPMS/i386
     rpm=$(ls myplc-[0-9]*.rpm)
     if [ ${#rpm[@]} != 1 ] ; then
-       echo "Cannot locate rpm for testing"
+       echo "$COMMAND: Cannot locate rpm for testing"
        exit 1
     fi
     url=${TESTBUILDURL}${PLDISTRO}/${BASE}/${rpm}
-    
-    cd /build
-  ### checkout the test material
-    svn co ${TESTSVNPATH} plctest
+
+    # find the place where the plctest material was checked out
+    cd /build/$BASE/build/CODEBASES/PLCAPI
+    if [ ! -d plctest/ ] ; then
+       echo "$COMMAND : Cannot not locate plctest/ - exiting"
+       exit 1
+    fi
   # compute test directory name on test box
-    testdir=plctest-${buildname}
+    testdir=plctest-${BASE}
   # rsync/push test material onto the test box
     ssh ${TESTBOXSSH} mkdir -p ${testdir}
     rsync -a -v plctest/ ${TESTBOXSSH}:${testdir}
   # invoke test on testbox
     ssh ${TESTBOXSSH} python -u ${testdir}/${TESTSCRIPT} ${url} 
-   #invoke make install from build to the testbox
-    make install PLCHOST=${TESTBOX}
+  #invoke make install from build to the testbox
+  # looks suspicious : we'd need this *during* myplc run, not at the end
+  # in addition we are not in the vserver here so running make can have weird effects
+  # make install PLCHOST=${TESTBOX}
        
   if [ "$?" != 0 ] ; then
        failure
@@ -282,7 +289,7 @@ function main () {
        cp $COMMANDPATH /vservers/${BASE}/build/
 
        # invoke this command in the vserver for building (-T)
-       vserver ${BASE} exec /build/$COMMAND -T "${argv[@]}" 
+       vserver ${BASE} exec /build/$COMMAND "${argv[@]}" 
 
        # if successful (we run in set -e), publish
        webpath=$(echo $WEBPATH | sed -e s,@PLDISTRO@,"$PLDISTRO",g -e s,@BASE@,"$BASE",g)
@@ -292,8 +299,10 @@ function main () {
        mkdir $webpath
        cp $myplcs $webpath
        
-       # invoke this command again for invoking tests
-       vserver ${BASE} exec /build/$COMMAND -B "${argv[@]}" 
+       # warning : need ssh in the vserver 
+       if [ -n "$DO_TEST" ] ; then 
+           runtest
+       fi
 
        success 
     else
@@ -302,12 +311,6 @@ function main () {
            build 
        fi
     
-       # need ssh in the vserver 
-       if [ -n "$DO_TEST" ] ; then 
-           runtest
-       fi
-
-
     fi
 
 }