diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2020-05-08 17:34:39 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2020-05-08 17:36:44 -0400 |
| commit | 54b7d45564e06a97ca30d9f8e64aa6cd007c2805 (patch) | |
| tree | 940a92842841abf6731b15a47d8404ded3a999f4 /src/ci | |
| parent | 7b805396bf46dce972692a6846ce2ad8481c5f85 (diff) | |
Use CDN for ci-caches on download
This will reduce costs, as well as lays the groundwork for developers to be able to locally pull the published docker images without needing AWS credentials.
Diffstat (limited to 'src/ci')
| -rwxr-xr-x | src/ci/docker/run.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index f29f9f3bf1c..d891ad1b668 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -17,6 +17,8 @@ dist=$objdir/build/dist source "$ci_dir/shared.sh" +CACHE_DOMAIN="${CACHE_DOMAIN:-ci-caches.rust-lang.org}" + if [ -f "$docker_dir/$image/Dockerfile" ]; then if [ "$CI" != "" ]; then hash_key=/tmp/.docker-hash-key.txt @@ -38,9 +40,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then cksum=$(sha512sum $hash_key | \ awk '{print $1}') - s3url="s3://$SCCACHE_BUCKET/docker/$cksum" - url="https://$SCCACHE_BUCKET.s3.amazonaws.com/docker/$cksum" - upload="aws s3 cp - $s3url" + url="https://$CACHE_DOMAIN/docker/$cksum" echo "Attempting to download $url" rm -f /tmp/rustci_docker_cache @@ -65,7 +65,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then -f "$dockerfile" \ "$context" - if [ "$upload" != "" ]; then + if [ "$CI" != "" ]; then + s3url="s3://$SCCACHE_BUCKET/docker/$cksum" + upload="aws s3 cp - $s3url" digest=$(docker inspect rust-ci --format '{{.Id}}') echo "Built container $digest" if ! grep -q "$digest" <(echo "$loaded_images"); then |
