# 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
show_env
### extract vbuild-init-vserver.sh and run it
- svn cat $SVNPATH/vbuild-init-vserver.sh > /tmp/vbuild-init-vserver-$$
+ svn cat $SVNPATH/vbuild-init-vserver.sh > /tmp/vbuild-$$.sh
# get -devel.lst
set +e
- svn cat $SVNPATH/${PLDISTRO}-devel-${FCDISTRO}.lst > /tmp/devel-$$.lst
+ svn cat $SVNPATH/${PLDISTRO}-devel-${FCDISTRO}.lst > /tmp/vbuild-devel-$$.lst
if [ "$?" = 0 ] ; then
- mv /tmp/devel-$$.lst /tmp/${PLDISTRO}-devel-${FCDISTRO}.lst
+ mv /tmp/vbuild-devel-$$.lst /tmp/${PLDISTRO}-devel-${FCDISTRO}.lst
else
- svn cat $SVNPATH/${PLDISTRO}-devel.lst > /tmp/devel-$$.lst
+ svn cat $SVNPATH/${PLDISTRO}-devel.lst > /tmp/vbuild-devel-$$.lst
if [ "$?" = 0 ] ; then
- mv /tmp/devel-$$.lst /tmp/${PLDISTRO}-devel.lst
+ mv /tmp/vbuild-devel-$$.lst /tmp/${PLDISTRO}-devel.lst
else
echo "$COMMAND: Cannot locate ${PLDISTRO}-devel.lst"
failure
# Create vserver
cd /tmp
- chmod +x vbuild-init-vserver-$$
- /tmp/vbuild-init-vserver-$$ ${BASE} ${FCDISTRO} ${PLDISTRO}
+ chmod +x vbuild-$$.sh
+ /tmp/vbuild-$$.sh ${BASE} ${FCDISTRO} ${PLDISTRO}
+ # cleanup
+ rm -f /tmp/vbuild-$$*
cd -
# Extract build
vserver ${BASE} exec svn checkout ${SVNPATH} /build
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