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
6518934b
Commit
6518934b
authored
Mar 11, 2016
by
Hunter Loftis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #296 from heroku/fiznool-master
Fiznool master
parents
a8cf29ac
e2dd7874
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
0 deletions
+48
-0
CHANGELOG.md
CHANGELOG.md
+5
-0
compile
bin/compile
+2
-0
dependencies.sh
lib/dependencies.sh
+10
-0
README.md
test/fixtures/pre-post-build-scripts/README.md
+1
-0
package.json
test/fixtures/pre-post-build-scripts/package.json
+16
-0
run
test/run
+14
-0
No files found.
CHANGELOG.md
View file @
6518934b
# Node.js Buildpack Changelog
# Node.js Buildpack Changelog
## Latest
-
Adds heroku-prebuild script
-
Adds heroku-postbuild script
## v88 (2016-2-23)
## v88 (2016-2-23)
-
Retries all curl requests
-
Retries all curl requests
...
...
bin/compile
View file @
6518934b
...
@@ -118,12 +118,14 @@ header "Restoring cache"
...
@@ -118,12 +118,14 @@ header "Restoring cache"
restore_cache | output
"
$LOG_FILE
"
restore_cache | output
"
$LOG_FILE
"
build_dependencies
()
{
build_dependencies
()
{
run_if_present
'heroku-prebuild'
if
$PREBUILD
;
then
if
$PREBUILD
;
then
echo
"Prebuild detected (node_modules already exists)"
echo
"Prebuild detected (node_modules already exists)"
rebuild_node_modules
"
$BUILD_DIR
"
rebuild_node_modules
"
$BUILD_DIR
"
else
else
install_node_modules
"
$BUILD_DIR
"
install_node_modules
"
$BUILD_DIR
"
fi
fi
run_if_present
'heroku-postbuild'
}
}
header
"Building dependencies"
header
"Building dependencies"
...
...
lib/dependencies.sh
View file @
6518934b
run_if_present
()
{
local
script_name
=
${
1
:-}
local
has_script
=
$(
read_json
"
$BUILD_DIR
/package.json"
".scripts[
\"
$script_name
\"
]"
)
if
[
-n
"
$has_script
"
]
;
then
echo
"Running
$script_name
"
npm run
"
$script_name
"
--if-present
fi
}
install_node_modules
()
{
install_node_modules
()
{
local
build_dir
=
${
1
:-}
local
build_dir
=
${
1
:-}
if
[
-e
$build_dir
/package.json
]
;
then
if
[
-e
$build_dir
/package.json
]
;
then
cd
$build_dir
cd
$build_dir
echo
"Pruning any extraneous modules"
echo
"Pruning any extraneous modules"
npm prune
--unsafe-perm
--userconfig
$build_dir
/.npmrc 2>&1
npm prune
--unsafe-perm
--userconfig
$build_dir
/.npmrc 2>&1
if
[
-e
$build_dir
/npm-shrinkwrap.json
]
;
then
if
[
-e
$build_dir
/npm-shrinkwrap.json
]
;
then
...
...
test/fixtures/pre-post-build-scripts/README.md
0 → 100644
View file @
6518934b
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
test/fixtures/pre-post-build-scripts/package.json
0 → 100644
View file @
6518934b
{
"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"
},
"engines"
:
{
"node"
:
"~0.10.0"
},
"scripts"
:
{
"heroku-prebuild"
:
"echo heroku-prebuild hook message"
,
"heroku-postbuild"
:
"echo heroku-postbuild hook message"
}
}
test/run
View file @
6518934b
#!/usr/bin/env bash
#!/usr/bin/env bash
# See README.md for info on running these tests.
# See README.md for info on running these tests.
testPrePostBuildScripts
()
{
compile
"pre-post-build-scripts"
assertCaptured
"Running heroku-prebuild"
assertCaptured
"echo heroku-prebuild hook message"
assertCaptured
"Running heroku-postbuild"
assertCaptured
"echo heroku-postbuild hook message"
assertCapturedSuccess
compile
"stable-node"
assertNotCaptured
"Running heroku-prebuild"
assertNotCaptured
"Running heroku-postbuild"
assertCapturedSuccess
}
testWarningsOnFailure
()
{
testWarningsOnFailure
()
{
compile
"many-warnings"
compile
"many-warnings"
assertCaptured
"troubleshooting-node-deploys"
assertCaptured
"troubleshooting-node-deploys"
...
...
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