# Notify recipient of failure or success, manage various stamps
function failure() {
set -x
- (echo -n "============================== $COMMAND: failure at" ; date ; tail -c 20k /log-build.txt) >> $LOG
+ (echo -n "============================== $COMMAND: failure at" ; date ; tail -c 20k $LOG) >> $(dirname $LOG)/build-broken.txt
if [ -n "$MAILTO" ] ; then
- tail -c 8k /log-build.txt | mail -s "Failures for ${BASE}" $MAILTO
+ tail -c 8k $LOG | mail -s "Failures for ${BASE}" $MAILTO
fi
exit 1
}
function success () {
set -x
- touch $(dirname $LOG)/build.ok
+ touch $(dirname $LOG)/build-ok.txt
if [ -n "$MAILTO" ] ; then
(echo "http://build.one-lab.org/$DISTRO/$BASE" ; echo "Completed on $(date)" ) | mail -s "Successfull build for ${BASE}" $MAILTO
fi
fi
done
BASE=${BASE}${i}
- LOG=/vservers/${BASE}/build/build-log.txt
+ LOG=/vservers/${BASE}-log.txt
mkdir -p $(dirname $LOG)
# redirect stdout and stderr from now on
exec > $LOG 2>&1
cd -
# Extract build
vserver ${BASE} exec svn checkout ${SVNPATH} /build
+ # redirect log again
+ LOG=/vservers/${BASE}/build/build-log.txt
+ exec > $LOG 2>&1
fi
echo "XXXXXXXXXX $COMMAND: preparation of vserver $BASE done" $(date)