From 52b03b054455c8d11d85f68fee4859828994f869 Mon Sep 17 00:00:00 2001 From: kevinseguin Date: Fri, 1 Apr 2016 15:52:13 -0400 Subject: [PATCH 1/3] try node 0.10.41 --- bin/compile_node | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile_node b/bin/compile_node index 31ea3cd..14c1792 100755 --- a/bin/compile_node +++ b/bin/compile_node @@ -34,7 +34,7 @@ export_env_dir $env_dir # What's the requested semver range for node? #node_engine=$(package_json ".engines.node") # Node version is locked for now: newer ones don't work with Meteor. -node_engine="0.10.40" +node_engine="0.10.41" node_previous=$(file_contents "$cache_dir/node/node-version") # What's the requested semver range for npm? From 6b72af5d1e288e033dec5476fa40d0147a5ca125 Mon Sep 17 00:00:00 2001 From: link Date: Mon, 1 Aug 2016 00:14:35 +1000 Subject: [PATCH 2/3] fix build_dir for compile_node --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 429b507..947258f 100755 --- a/bin/compile +++ b/bin/compile @@ -19,5 +19,5 @@ source $bp_dir/bin/common.sh # Install node first, as a dependency, then install meteor & build app -$bp_dir/bin/compile_node "$1" "$2" +$bp_dir/bin/compile_node "$1/app_src" "$2" $bp_dir/bin/compile_meteor "$1" "$2" From 793c0b18992ceb405aa1cdc0bd78c3f1db3d0e4c Mon Sep 17 00:00:00 2001 From: link Date: Mon, 1 Aug 2016 01:10:28 +1000 Subject: [PATCH 3/3] update since previous solution is incorrect --- bin/compile | 2 +- bin/compile_node | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/bin/compile b/bin/compile index 947258f..429b507 100755 --- a/bin/compile +++ b/bin/compile @@ -19,5 +19,5 @@ source $bp_dir/bin/common.sh # Install node first, as a dependency, then install meteor & build app -$bp_dir/bin/compile_node "$1/app_src" "$2" +$bp_dir/bin/compile_node "$1" "$2" $bp_dir/bin/compile_meteor "$1" "$2" diff --git a/bin/compile_node b/bin/compile_node index 14c1792..fea4b4e 100755 --- a/bin/compile_node +++ b/bin/compile_node @@ -11,6 +11,7 @@ set -o pipefail # don't ignore exit codes when piping output build_dir=$1 cache_dir=$2 env_dir=$3 +app_source=$build_dir/app_src bp_dir=$(cd $(dirname $0); cd ..; pwd) heroku_dir=$build_dir/.heroku mkdir -p $heroku_dir/node @@ -42,16 +43,16 @@ npm_engine=$(package_json ".engines.npm") npm_previous=$(file_contents "$cache_dir/node/npm-version") # How does this app start? -if test -f $build_dir/Procfile; then start_method="Procfile" +if test -f $app_source/Procfile; then start_method="Procfile" elif [[ $(package_json ".scripts.start") != "" ]]; then start_method="npm start" -elif [ -f $build_dir/server.js ]; then start_method="server.js" +elif [ -f $app_source/server.js ]; then start_method="server.js" else start_method="" fi # What's the source-of-truth for node_modules? -if test -d $build_dir/node_modules; then modules_source="prebuilt" -elif test -f $build_dir/npm-shrinkwrap.json; then modules_source="npm-shrinkwrap.json" -elif test -f $build_dir/package.json; then modules_source="package.json" +if test -d $app_source/node_modules; then modules_source="prebuilt" +elif test -f $app_source/npm-shrinkwrap.json; then modules_source="npm-shrinkwrap.json" +elif test -f $app_source/package.json; then modules_source="package.json" else modules_source="" fi @@ -105,7 +106,7 @@ if [ "$npm_engine" != "" ]; then fi # Run subsequent commands from the build directory -cd $build_dir +cd $app_source ####### Build the project's dependencies @@ -134,20 +135,20 @@ elif [ $modules_source == "prebuilt" ]; then info "Rebuilding any native modules for this architecture" npm rebuild 2>&1 | indent info "Installing any new modules" - npm install --quiet --userconfig $build_dir/.npmrc 2>&1 | indent + npm install --quiet --userconfig $app_source/.npmrc 2>&1 | indent elif $use_cache; then info "Restoring node modules from cache" - cp -r $cache_dir/node/node_modules $build_dir/ + cp -r $cache_dir/node/node_modules $app_source/ info "Pruning unused dependencies" npm prune 2>&1 | indent info "Installing any new modules" - npm install --quiet --userconfig $build_dir/.npmrc 2>&1 | indent + npm install --quiet --userconfig $app_source/.npmrc 2>&1 | indent else info "Installing node modules" - touch $build_dir/.npmrc - npm install --quiet --userconfig $build_dir/.npmrc 2>&1 | indent + touch $app_source/.npmrc + npm install --quiet --userconfig $app_source/.npmrc 2>&1 | indent fi ####### Create a Procfile if possible @@ -158,10 +159,10 @@ if [ "$start_method" == "Procfile" ]; then info "Found Procfile" elif [ "$start_method" == "npm start" ]; then info "No Procfile; Adding 'web: npm start' to new Procfile" - echo "web: npm start" > $build_dir/Procfile + echo "web: npm start" > $app_source/Procfile elif [ "$start_method" == "server.js" ]; then info "No Procfile; Adding 'web: node server.js' to new Procfile" - echo "web: node server.js" > $build_dir/Procfile + echo "web: node server.js" > $app_source/Procfile fi ####### Create the runtime environment (profile.d) @@ -175,8 +176,8 @@ echo "export PATH=\"\$HOME/.heroku/node/bin:\$HOME/bin:\$HOME/node_modules/.bin: echo "export NODE_HOME=\"\$HOME/.heroku/node\"" >> $build_dir/.profile.d/nodejs.sh info "Exporting binary paths" -echo "export PATH=\"$build_dir/.heroku/node/bin:$build_dir/node_modules/.bin:\$PATH\"" > $bp_dir/export -echo "export NODE_HOME=\"$build_dir/.heroku/node\"" >> $bp_dir/export +echo "export PATH=\"$heroku_dir/node/bin:$build_dir/node_modules/.bin:\$PATH\"" > $bp_dir/export +echo "export NODE_HOME=\"$heroku_dir/node\"" >> $bp_dir/export ####### Clean up @@ -198,9 +199,9 @@ mkdir -p $cache_dir/node echo $node_engine > $cache_dir/node/node-version echo $npm_engine > $cache_dir/node/npm-version -if test -d $build_dir/node_modules; then +if test -d $app_source/node_modules; then info "Caching node_modules for future builds" - cp -r $build_dir/node_modules $cache_dir/node + cp -r $app_source/node_modules $cache_dir/node fi # Show the final dependency tree