Skip to content

Commit

Permalink
[CI] record docker image info for reuse
Browse files Browse the repository at this point in the history
This writes an extra `dist/image-$image.txt` which contains the S3 URL
of the cached image and the `sha256` digest of the docker entry point.
This will be uploaded with the rest of the deployed artifacts in the
Travis `after_success` script.
  • Loading branch information
cuviper committed Mar 25, 2019
1 parent d91b32b commit 9e66303
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ci_dir="`dirname $docker_dir`"
src_dir="`dirname $ci_dir`"
root_dir="`dirname $src_dir`"

objdir=$root_dir/obj
dist=$objdir/build/dist

source "$ci_dir/shared.sh"

travis_fold start build_docker
Expand Down Expand Up @@ -77,6 +80,11 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
else
echo "Looks like docker image is the same as before, not uploading"
fi
# Record the container image for reuse, e.g. by rustup.rs builds
info="$dist/image-$image.txt"
mkdir -p "$dist"
echo "$url" >"$info"
echo "$digest" >>"$info"
fi
elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
if [ -n "$TRAVIS_OS_NAME" ]; then
Expand All @@ -99,8 +107,6 @@ fi
travis_fold end build_docker
travis_time_finish

objdir=$root_dir/obj

mkdir -p $HOME/.cargo
mkdir -p $objdir/tmp
mkdir -p $objdir/cores
Expand Down

0 comments on commit 9e66303

Please sign in to comment.