mirror of
https://github.com/inspec/inspec
synced 2025-02-18 06:58:40 +00:00
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 <zenspider@chef.io>
This commit is contained in:
parent
15a70539b8
commit
d6843db397
1 changed files with 8 additions and 2 deletions
|
@ -39,13 +39,19 @@ if [ -f bundle.tar.gz ]; then
|
||||||
tar -xzf bundle.tar.gz
|
tar -xzf bundle.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then
|
||||||
|
rm bundle.sha256
|
||||||
|
fi
|
||||||
|
|
||||||
bundle config --local path vendor/bundle
|
bundle config --local path vendor/bundle
|
||||||
bundle install --jobs=7 --retry=3 --without tools maintenance deploy
|
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"
|
echo "Bundled gems have not changed. Skipping upload to s3"
|
||||||
else
|
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/
|
tar -czf bundle.tar.gz vendor/
|
||||||
push_s3_file bundle.tar.gz
|
push_s3_file bundle.tar.gz
|
||||||
push_s3_file bundle.sha256
|
push_s3_file bundle.sha256
|
||||||
|
|
Loading…
Add table
Reference in a new issue