From 7def3f0c82a95ee9147c969e94665418bf77468c Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 10 May 2018 20:00:29 +0800 Subject: Retry when downloading the Docker cache. Prevent spuriously needing to rebuild the docker image when the network was down. Also, adjusted the retry function to insert a sleep between retries, because retrying immediately will often just hit the same issue. --- src/ci/docker/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ci/docker') diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index c470ae7eb30..3465e386cd9 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -36,8 +36,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then s3url="s3://$SCCACHE_BUCKET/docker/$cksum" url="https://s3-us-west-1.amazonaws.com/$SCCACHE_BUCKET/docker/$cksum" echo "Attempting to download $s3url" + rm -f /tmp/rustci_docker_cache set +e - loaded_images=$(curl $url | docker load | sed 's/.* sha/sha/') + retry curl -f -L -C - -o /tmp/rustci_docker_cache "$url" + loaded_images=$(docker load -i /tmp/rustci_docker_cache | sed 's/.* sha/sha/') set -e echo "Downloaded containers:\n$loaded_images" fi -- cgit 1.4.1-3-g733a5