summary refs log tree commit diff
path: root/src/ci/docker
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-05-10 11:35:38 -0500
committerGitHub <noreply@github.com>2018-05-10 11:35:38 -0500
commit694ba9c04b8ab1d8a76e2549b213428f093bb359 (patch)
tree262911f5e848b72735c4086a0d95bc00e3da0bf2 /src/ci/docker
parent74e731fcb07de3527c84e9a30821034784aa40cd (diff)
parent7def3f0c82a95ee9147c969e94665418bf77468c (diff)
downloadrust-694ba9c04b8ab1d8a76e2549b213428f093bb359.tar.gz
rust-694ba9c04b8ab1d8a76e2549b213428f093bb359.zip
Rollup merge of #50606 - kennytm:retry-docker-cache, r=alexcrichton
Retry when downloading the Docker cache.

As a safety measure, prevent spuriously needing to rebuild the docker image in case the network was reset while downloading.

Also, adjusted the retry function to insert a sleep between retries, because retrying immediately will often just hit the same issue.
Diffstat (limited to 'src/ci/docker')
-rwxr-xr-xsrc/ci/docker/run.sh4
1 files changed, 3 insertions, 1 deletions
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