Commit 25a2e022 authored by Hunter Loftis's avatar Hunter Loftis

rename BUILD_CLEAN to DISABLE_BUILD_CACHE for clarity

parent 173425a3
...@@ -75,13 +75,13 @@ as long as they fall within acceptable semver ranges, ...@@ -75,13 +75,13 @@ as long as they fall within acceptable semver ranges,
which can lead to outdated modules. which can lead to outdated modules.
```shell ```shell
heroku config:set BUILD_CLEAN=true heroku config:set DISABLE_BUILD_CACHE=true
git commit -am 'build' --allow-empty git commit -am 'build' --allow-empty
git push heroku master git push heroku master
heroku config:unset BUILD_CLEAN heroku config:unset DISABLE_BUILD_CACHE
``` ```
Default: `BUILD_CLEAN` defaults to false Default: `DISABLE_BUILD_CACHE` defaults to false
### Enable or disable devDependencies installation ### Enable or disable devDependencies installation
......
...@@ -33,7 +33,7 @@ trap build_failed ERR ...@@ -33,7 +33,7 @@ trap build_failed ERR
# Load config vars into environment; start with defaults # Load config vars into environment; start with defaults
export NPM_CONFIG_PRODUCTION=true export NPM_CONFIG_PRODUCTION=true
export BUILD_CLEAN=false export DISABLE_BUILD_CACHE=false
if [ -d "$env_dir" ]; then if [ -d "$env_dir" ]; then
export_env_dir $env_dir export_env_dir $env_dir
...@@ -81,7 +81,7 @@ info "node_modules cached: $modules_cached" ...@@ -81,7 +81,7 @@ info "node_modules cached: $modules_cached"
echo "" echo ""
info "NPM_CONFIG_PRODUCTION=$NPM_CONFIG_PRODUCTION" info "NPM_CONFIG_PRODUCTION=$NPM_CONFIG_PRODUCTION"
info "BUILD_CLEAN=$BUILD_CLEAN" info "DISABLE_BUILD_CACHE=$DISABLE_BUILD_CACHE"
source $bp_dir/bin/warnings.sh source $bp_dir/bin/warnings.sh
...@@ -145,7 +145,7 @@ elif [ $modules_source == "prebuilt" ]; then ...@@ -145,7 +145,7 @@ elif [ $modules_source == "prebuilt" ]; then
info "Rebuilding any native modules for this architecture" info "Rebuilding any native modules for this architecture"
npm rebuild 2>&1 npm rebuild 2>&1
elif ! $BUILD_CLEAN && ! $cache_busted; then elif ! $DISABLE_BUILD_CACHE && ! $cache_busted; then
info "Restoring node modules from cache" info "Restoring node modules from cache"
cp -r $cache_dir/node/node_modules $build_dir/ cp -r $cache_dir/node/node_modules $build_dir/
info "Pruning unused dependencies" info "Pruning unused dependencies"
......
...@@ -178,20 +178,20 @@ testDevDependencies() { ...@@ -178,20 +178,20 @@ testDevDependencies() {
assertCapturedSuccess assertCapturedSuccess
} }
testBuildClean() { testDisableCache() {
cache=$(mktmpdir) cache=$(mktmpdir)
env_dir=$(mktmpdir) env_dir=$(mktmpdir)
compile "build-clean-1" $cache compile "disable-build-cache-1" $cache
assertCaptured "lodash@1.0.0" assertCaptured "lodash@1.0.0"
assertCapturedSuccess assertCapturedSuccess
compile "build-clean-2" $cache compile "disable-build-cache-2" $cache
assertCaptured "lodash@1.0.0" assertCaptured "lodash@1.0.0"
assertCapturedSuccess assertCapturedSuccess
echo "true" > $env_dir/BUILD_CLEAN echo "true" > $env_dir/DISABLE_BUILD_CACHE
compile "build-clean-2" $cache $env_dir compile "disable-build-cache-2" $cache $env_dir
assertCaptured "lodash@1.3.1" assertCaptured "lodash@1.3.1"
assertCapturedSuccess assertCapturedSuccess
} }
......
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