# web publishing results
WEBPATH=/build/@PLDISTRO@/@BASE@
-WEBLOG=/build/@PLDISTRO@/@BASE@.txt
# for the test part
TESTBUILDURL="http://build.one-lab.org/"
echo -n "============================== Starting $COMMAND:runtest on "
date
- ### compute URL to the myplc package
- cd /build
- rpm=$(find RPMS -name myplc\*.rpm )
+ ### the URL to the myplc package
+ cd /build/RPMS/i386
+ rpm=$(ls myplc-[0-9]*.rpm)
+ if [ ${#rpm} != 1 ] ; then
+ echo "Cannot locate rpm for testing"
+ exit 1
+ fi
url=${TESTBUILDURL}${PLDISTRO}/${BASE}/${rpm}
+
+ cd /build
### checkout the test material
svn co ${TESTSVNPATH} plctest
# compute test directory name on test box
LOG=$LOG2
echo "XXXXXXXXXX $COMMAND: preparation of vserver $BASE done" $(date)
- cp $COMMANDPATH /vservers/${BASE}/
- # invoke this command in the vserver
- vserver ${BASE} exec /$COMMAND "${argv[@]}"
+ cp $COMMANDPATH /vservers/${BASE}/build/
+
+ # invoke this command in the vserver for building (-T)
+ vserver ${BASE} exec /build/$COMMAND -T "${argv[@]}"
- # publish
+ # if successful (we run in set -e), publish
webpath=$(echo $WEBPATH | sed -e s,@PLDISTRO@,"$PLDISTRO",g -e s,@BASE@,"$BASE",g)
- weblog=$(echo $WEBLOG | sed -e s,@PLDISTRO@,"$PLDISTRO",g -e s,@BASE@,"$BASE",g)
- rm -f $webpath
- ln -s /vservers/$BASE/build $webpath
- rm -f $weblog
- ln -s $LOG $weblog
+ weblog=${webpath}.txt
+ rm -rf $webpath $weblog
+ myplcs=$(find /vservers/$BASE/build/RPMS -name myplc\*rpm)
+ mkdir $webpath
+ cp $myplcs $webpath
+ # invoke this command again for invoking tests
+ vserver ${BASE} exec /build/$COMMAND -B "${argv[@]}"
+
+ success
else
LOG=/build/build-log.txt
if [ -n "$DO_BUILD" ] ; then
build
- touch /build-ok
fi
-# todo :
-# ssh is missing in the vserver
-# and in any case the way it's done now, the stuff gets published AFTER the test is run
-# if [ -n "$DO_TEST" ] ; then
-# runtest
-# fi
+ # need ssh in the vserver
+ if [ -n "$DO_TEST" ] ; then
+ runtest
+ fi
- success
fi