BUILD_END=$(date +%s)
$SCRIPTSDIR/liveboot2db.py $JOB_NAME $BUILD_NUMBER $REQUEST_ID $BUILD_START $BUILD_END "failed"
build_name=$(basename $(readlink -f /srv/build/liveboot/builds/last))
- # cleanup mount points
- cd /var/cache/pbuilder/build
echo "My PID: $$"
- sudo umount -l $$/proc || true
- sudo umount -l $$/dev || true
- sudo umount -l $$/dev/pts || true
- sudo umount -l $$/srv/build || true
exit 1
}
#
# Define default settings
#
-export DIST=squeeze
-export PB_SUITE=production-proposed-updates
+DIST=squeeze
SCRIPTSDIR=$(dirname $0)
BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX)
cat > $BUILD_SCRIPT <<-EOF
+#!/bin/sh
+set -ex
cd /srv/build
rm liveboot -rf
git clone git://git/ri/liveboot.git
[ -d /srv/build/cache ] && mv /srv/build/cache .
./build.sh $JOB_NAME $BUILD_NUMBER $GIT_BRANCH $REQUEST_ID
EOF
+chmod +x $BUILD_SCRIPT
#
# add liveboot build to cidb
#
# build liveboot
-# (sudo is called from within a(nother) script as it's not possible to trap sudo directly
#
-echo "sudo pbuilder --execute --bindmounts /srv/build/ -- $BUILD_SCRIPT" > ${BUILD_SCRIPT}_sudo
-bash -x ${BUILD_SCRIPT}_sudo
-rm $BUILD_SCRIPT ${BUILD_SCRIPT}_sudo
+schroot -c liveboot-$DIST -u root -d /srv/build -- $BUILD_SCRIPT
+rm $BUILD_SCRIPT
#
# add liveboot build result to cidb