diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-09-07 17:56:46 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-09-07 17:56:46 +0200 |
commit | f1fef99224089d7d41b953aea1232f429c180687 (patch) | |
tree | 40b3941ac20318bbbcee7d22c74ee057a0293548 /bin/reproducible_build.sh | |
parent | 45bc64eb4310d1f0c9f14d0c2dd29f46a0229277 (diff) | |
download | jenkins.debian.net-f1fef99224089d7d41b953aea1232f429c180687.tar.xz |
reproducible: retry rsync on failure but sleep 5min before doing so
Diffstat (limited to 'bin/reproducible_build.sh')
-rwxr-xr-x | bin/reproducible_build.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 58bea996..27a82b20 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -407,9 +407,9 @@ get_source_package() { if [ $RESULT != 0 ] || [ "$(ls ${SRCPACKAGE}_*.dsc 2> /dev/null)" = "" ] ; then # sometimes apt-get cannot download a package for whatever reason. # if so, wait some time and try again. only if that fails, give up. - echo "Download of ${SRCPACKAGE} sources from ${SUITE} failed." | tee -a ${RBUILDLOG} + echo "$(date -u ) - download of ${SRCPACKAGE} sources from ${SUITE} failed." | tee -a ${RBUILDLOG} ls -l ${SRCPACKAGE}* | tee -a ${RBUILDLOG} - echo "Sleeping 5m before re-trying..." | tee -a ${RBUILDLOG} + echo "$(date -u ) - sleeping 5m before re-trying..." | tee -a ${RBUILDLOG} sleep 5m schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG} RESULT=$? @@ -514,7 +514,13 @@ remote_build() { rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/ RESULT=$? if [ $RESULT -ne 0 ] ; then - handle_unhandled "error when rsyncing remote build results" + echo "$(date -u ) - rsync from $NODE failed, sleeping 5m before re-trying..." | tee -a ${RBUILDLOG} + sleep 5m + rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/ + RESULT=$? + if [ $RESULT -ne 0 ] ; then + handle_unhandled "error when rsyncing remote build results" + fi fi ls -R $TMPDIR ssh -p $PORT $NODE "rm -r $TMPDIR" |