Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
aef26985
Commit
aef26985
authored
Jul 23, 2015
by
Hunter Loftis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #252 from heroku/node-env-prod
default to NODE_ENV=production for build and runtime
parents
aeac9d6e
459ebb67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
CHANGELOG.md
CHANGELOG.md
+1
-0
environment.sh
lib/environment.sh
+7
-0
nodejs.sh
profile/nodejs.sh
+1
-6
No files found.
CHANGELOG.md
View file @
aef26985
...
...
@@ -2,6 +2,7 @@
-
Fix runtime signature cache invalidation
-
Provide error messaging for un-downloadable binaries
-
Default to NODE_ENV=production for both build and runtime
## v77
...
...
lib/environment.sh
View file @
aef26985
...
...
@@ -2,12 +2,19 @@ create_default_env() {
export
NPM_CONFIG_PRODUCTION
=
${
NPM_CONFIG_PRODUCTION
:-
true
}
export
NPM_CONFIG_LOGLEVEL
=
${
NPM_CONFIG_LOGLEVEL
:-
error
}
export
NODE_MODULES_CACHE
=
${
NODE_MODULES_CACHE
:-
true
}
export
NODE_ENV
=
${
NODE_ENV
:-
production
}
}
list_node_config
()
{
echo
""
printenv
|
grep
^NPM_CONFIG_
||
true
printenv
|
grep
^NODE_
||
true
if
[
"
$NPM_CONFIG_PRODUCTION
"
=
"true"
]
&&
[
"
$NODE_ENV
"
!=
"production"
]
;
then
echo
""
echo
"npm scripts will see NODE_ENV=production (not '
${
NODE_ENV
}
')"
echo
"https://docs.npmjs.com/misc/config#production"
fi
}
export_env_dir
()
{
...
...
profile/nodejs.sh
View file @
aef26985
...
...
@@ -10,11 +10,6 @@ calculate_concurrency() {
WEB_CONCURRENCY
=
$WEB_CONCURRENCY
}
log_concurrency
()
{
echo
"Detected
$MEMORY_AVAILABLE
MB available memory,
$WEB_MEMORY
MB limit per process (WEB_MEMORY)"
echo
"Recommending WEB_CONCURRENCY=
$WEB_CONCURRENCY
"
}
detect_memory
()
{
local
default
=
$1
local
limit
=
$(
ulimit
-u
)
...
...
@@ -29,9 +24,9 @@ detect_memory() {
export
PATH
=
"
$HOME
/.heroku/node/bin:
$HOME
/bin:
$HOME
/node_modules/.bin:
$PATH
"
export
NODE_HOME
=
"
$HOME
/.heroku/node"
export
NODE_ENV
=
${
NODE_ENV
:-
production
}
calculate_concurrency
log_concurrency
export
MEMORY_AVAILABLE
=
$MEMORY_AVAILABLE
export
WEB_MEMORY
=
$WEB_MEMORY
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment