diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-09-02 14:27:23 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-09-02 14:27:23 +0200 |
commit | f2eb7acbbca71cf28dcfa8f689c3f8059e42670e (patch) | |
tree | b4f2adcf2c87c403aae7d900d65d033e73c51943 /bin/reproducible_maintenance.sh | |
parent | ea2473c2ae2bc2a34d020a922b7528f1ac6d0a5d (diff) | |
download | jenkins.debian.net-f2eb7acbbca71cf28dcfa8f689c3f8059e42670e.tar.xz |
reproducibly: retry 'apt-get update' three times for each schroot before giving up, also fail gracefully
Diffstat (limited to 'bin/reproducible_maintenance.sh')
-rwxr-xr-x | bin/reproducible_maintenance.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 492e6fec..890185f0 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -267,5 +267,20 @@ for s in $SUITES ; do continue fi echo "$(date -u) - updating the $s/$ARCH schroot now." - schroot --directory /root -u root -c source:jenkins-reproducible-$s -- apt-get update + set +e + for i in 1 2 3 ; do + schroot --directory /root -u root -c source:jenkins-reproducible-$s -- apt-get update + RESULT=$? + if [ $RESULT -eq 1 ] ; then + # sleep 31-100 secs + echo "Sleeping some time... (to workaround network problems like 'Hash Sum mismatch'...)" + /bin/sleep $(echo "scale=1 ; ($(shuf -i 1-700 -n 1)/10)+30" | bc ) + echo "$(date -u) - Retrying to update the $s/$ARCH schroot." + elif [ $RESULT -eq 0 ] ; then + continue + fi + done + if [ $RESULT -eq 1 ] ; then + echo "Warning: failed to update the $s/$ARCH schroot." + fi done |