From 5161633ac58883b9a19ce1aa1a9ef93a2bbc26bf Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 25 Feb 2015 21:13:57 +0100 Subject: chroot-installation: workaround temporarily network failures --- bin/chroot-installation.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin/chroot-installation.sh') diff --git a/bin/chroot-installation.sh b/bin/chroot-installation.sh index 11a27da5..fd6dcb2d 100755 --- a/bin/chroot-installation.sh +++ b/bin/chroot-installation.sh @@ -49,25 +49,29 @@ cleanup_all() { } execute_ctmpfile() { + echo "echo xxxxxSUCCESSxxxxx" >> $CTMPFILE set -x chmod +x $CTMPFILE - #sudo chroot $CHROOT_TARGET $TMPFILE set -o pipefail # see eg http://petereisentraut.blogspot.com/2010/11/pipefail.html - if ! $(sudo chroot $CHROOT_TARGET $TMPFILE 2>&1 | tee $TMPLOG) ; then + (sudo chroot $CHROOT_TARGET $TMPFILE 2>&1 | tee $TMPLOG) || true + RESULT=$(grep "xxxxxSUCCESSxxxxx" $TMPLOG || true) + if [ -z "$RESULT" ] ; then RESULT=$(egrep "Failed to fetch.*Unable to connect to" $TMPLOG || true) if [ ! -z "$RESULT" ] ; then echo + echo "Warning: Network problem detected." echo "Trying to workaround temporarily failure fetching packages, trying again..." + kgb-client --conf /srv/jenkins/kgb/debian-qa.conf --relay-msg "h01ger: check $BUILD_URL for 'Trying to workaround'..." echo sudo chroot $CHROOT_TARGET $TMPFILE else + echo "Failed to run $TMPFILE in $CHROOT_TARGET." exit 1 fi fi rm $CTMPFILE set +o pipefail set +x - echo "Debug: This should only be printed on success." } prepare_bootstrap() { -- cgit v1.2.3-54-g00ecf