From d6843db397867fa4080f9ce5dfc255e8c4d296b6 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Thu, 31 Oct 2019 16:28:50 -0700 Subject: [PATCH] Fix false positives on bundle caching check in buildkite. + This adds RESET_BUNDLE_CACHE so we can forcibly reset. + Now computes the sha against the Gemfile.lock. + Other minor fixes as pointed out by shellcheck. Signed-off-by: Ryan Davis --- .expeditor/buildkite/verify.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.expeditor/buildkite/verify.sh b/.expeditor/buildkite/verify.sh index 06563c4bc..86569637d 100755 --- a/.expeditor/buildkite/verify.sh +++ b/.expeditor/buildkite/verify.sh @@ -39,13 +39,19 @@ if [ -f bundle.tar.gz ]; then tar -xzf bundle.tar.gz fi +if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then + rm bundle.sha256 +fi + bundle config --local path vendor/bundle bundle install --jobs=7 --retry=3 --without tools maintenance deploy -if [[ -f bundle.tar.gz && -f bundle.sha256 ]] && shasum --check bundle.sha256 --status; then +echo "--- bundle cache" +if test -f bundle.sha256 && shasum --check bundle.sha256 --status; then echo "Bundled gems have not changed. Skipping upload to s3" else - shasum -a 256 vendor/bundle > bundle.sha256 + echo "Bundled gems have changed. Uploading to s3" + shasum -a 256 Gemfile.lock > bundle.sha256 tar -czf bundle.tar.gz vendor/ push_s3_file bundle.tar.gz push_s3_file bundle.sha256