Attempt to fix bundle caching.

Unfortunately, I can only test this via commits to BK...

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-12-03 15:04:52 -08:00
parent c73569fe6b
commit 14e835e4cc

View file

@ -42,6 +42,7 @@ if [ -z "${SKIP_BUNDLE_CACHE:-}" ]; then
if [ -f bundle.tar.gz ]; then if [ -f bundle.tar.gz ]; then
tar -xzf bundle.tar.gz tar -xzf bundle.tar.gz
mv Gemfile.lock Gemfile.lock.old || true
fi fi
if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then
@ -58,8 +59,9 @@ if [ -z "${SKIP_BUNDLE_CACHE:-}" ]; then
echo "Bundled gems have not changed. Skipping upload to s3" echo "Bundled gems have not changed. Skipping upload to s3"
else else
echo "Bundled gems have changed. Uploading to s3" echo "Bundled gems have changed. Uploading to s3"
diff -u Gemfile.lock.old Gemfile.lock || true
shasum -a 256 Gemfile.lock > bundle.sha256 shasum -a 256 Gemfile.lock > bundle.sha256
tar -czf bundle.tar.gz vendor/ tar -czf bundle.tar.gz Gemfile.lock vendor/
push_s3_file bundle.tar.gz push_s3_file bundle.tar.gz
push_s3_file bundle.sha256 push_s3_file bundle.sha256
fi fi