Commit 3bebde81 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Add $PREBUILD to cache signature (#405)

The buildpack should bust the cache whenever the PREBUILD boolean changes
to prevent the user from caching their local node_modules directory

Fixes #399
parent eff98f61
source $BP_DIR/lib/binaries.sh
create_signature() {
echo "$(node --version); $(npm --version); $(yarn --version 2>/dev/null || true)"
echo "$(node --version); $(npm --version); $(yarn --version 2>/dev/null || true) $PREBUILD"
}
save_signature() {
......
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
{
"name": "node-buildpack-test-app",
"version": "0.0.1",
"description": "node buildpack integration test app",
"repository" : {
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"scripts": {
"start": "node server.js"
}
}
......@@ -68,6 +68,19 @@ testBuildWithCache() {
assertCapturedSuccess
}
testCacheWithPrebuild() {
local cache=$(mktmpdir)
local env_dir=$(mktmpdir)
echo 'true' > "$env_dir"/PREBUILD
compile "cache-prebuild" $cache
assertCapturedSuccess
compile "cache-prebuild" $cache $env_dir
assertCaptured "Skipping cache restore (new-signature"
assertCapturedSuccess
}
testYarnSemver() {
compile "yarn-semver"
assertCaptured "Resolving yarn version ~0.17"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment