diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-02-25 21:13:57 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-02-25 21:15:06 +0100 |
commit | 5161633ac58883b9a19ce1aa1a9ef93a2bbc26bf (patch) | |
tree | 71b05f63c12ceef74e2b9582a6c98fe09b2603f0 /bin | |
parent | 826ae823fe9b9ea8e09299a62ad4bc36c85f0ef3 (diff) | |
download | jenkins.debian.net-5161633ac58883b9a19ce1aa1a9ef93a2bbc26bf.tar.xz |
chroot-installation: workaround temporarily network failures
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/chroot-installation.sh | 10 |
1 files changed, 7 insertions, 3 deletions
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() { |