summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-10-18 13:39:13 +0200
committerHolger Levsen <holger@layer-acht.org>2015-10-18 13:39:13 +0200
commit9f71b2f181320fb42b4e5fff590074d716756643 (patch)
treebd46a580240b3b265bbf20c36b602c5adbd92f6a /bin
parentbb4d84c16d120d353b8c1ae86e4b623c9b90783d (diff)
downloadjenkins.debian.net-9f71b2f181320fb42b4e5fff590074d716756643.tar.xz
reproducible arch: let build time out after 4h
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_build_arch_pkg.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/bin/reproducible_build_arch_pkg.sh b/bin/reproducible_build_arch_pkg.sh
index 5c2be897..d51b9c65 100755
--- a/bin/reproducible_build_arch_pkg.sh
+++ b/bin/reproducible_build_arch_pkg.sh
@@ -19,7 +19,7 @@ cleanup_all() {
rm $TMPDIR -r
echo "$(date -u) - $TMPDIR deleted."
fi
- # delete makekpg build dir
+ # delete makepkg build dir
if [ ! -z $SRCPACKAGE ] && [ -d /tmp/$SRCPACKAGE-$(basename $TMPDIR) ] ; then
rm -r /tmp/$SRCPACKAGE-$(basename $TMPDIR)
fi
@@ -54,7 +54,13 @@ first_build() {
schroot --run-session -c $SESSION --directory /tmp -- cp -r /var/abs/core/$SRCPACKAGE $BUILDDIR/
# just set timezone in the 1st build
echo 'export TZ="/usr/share/zoneinfo/Etc/GMT+12"' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
- schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+ # nicely run makepkg with a timeout of 4h
+ timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
+ schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+ PRESULT=${PIPESTATUS[0]}
+ if [ $PRESULT -eq 124 ] ; then
+ echo "$(date -u) - makepkg was killed by timeout after 4h." | tee -a $LOG
+ fi
schroot --end-session -c $SESSION
if ! "$DEBUG" ; then set +x ; fi
}
@@ -79,7 +85,13 @@ second_build() {
echo 'export LANG="fr_CH.UTF-8"' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
echo 'export LC_ALL="fr_CH.UTF-8' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
echo 'umask 0002' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
- schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+ # nicely run makepkg with a timeout of 4h
+ timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
+ schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+ PRESULT=${PIPESTATUS[0]}
+ if [ $PRESULT -eq 124 ] ; then
+ echo "$(date -u) - makepkg was killed by timeout after 4h." | tee -a $LOG
+ fi
schroot --end-session -c $SESSION
if ! "$DEBUG" ; then set +x ; fi
}