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
e9266dfe
Commit
e9266dfe
authored
Dec 11, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests around creating a default Procfile
parent
d93ee4ce
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
5 deletions
+54
-5
compile
bin/compile
+6
-5
test
bin/test
+13
-0
README.md
test/procfile-absent-npm-start-absent/README.md
+1
-0
package.json
test/procfile-absent-npm-start-absent/package.json
+15
-0
README.md
test/procfile-absent-npm-start-present/README.md
+1
-0
package.json
test/procfile-absent-npm-start-present/package.json
+18
-0
No files found.
bin/compile
View file @
e9266dfe
...
@@ -80,14 +80,15 @@ status "Cleaning up node-gyp and npm artifacts"
...
@@ -80,14 +80,15 @@ status "Cleaning up node-gyp and npm artifacts"
rm
-rf
"
$build_dir
/.node-gyp"
rm
-rf
"
$build_dir
/.node-gyp"
rm
-rf
"
$build_dir
/.npm"
rm
-rf
"
$build_dir
/.npm"
#
Add npm start to Procfile if necessary
#
If Procfile is absent, try to create one using `npm start`
if
[
!
-e
$build_dir
/Procfile
]
;
then
if
[
!
-e
$build_dir
/Procfile
]
;
then
npm_start
=
$(
cat
$build_dir
/package.json |
$bp_dir
/vendor/jq
-r
.scripts.start
)
npm_start
=
$(
cat
$build_dir
/package.json |
$bp_dir
/vendor/jq
-r
.scripts.start
)
# If a start script is declared, add it to a Procfile
if
[
"
$npm_start
"
==
"null"
]
;
then
if
[
"
$npm_start
"
!=
"null"
]
;
then
protip
"Create a Procfile or specify a start script in package.json"
status
"No Procfile present; adding npm start script to Procfile"
else
echo
"web:
$npm_start
"
>
$build_dir
/Procfile
status
"No Procfile found; adding npm start script to Procfile"
echo
"web: npm start"
>
$build_dir
/Procfile
fi
fi
fi
fi
...
...
bin/test
View file @
e9266dfe
...
@@ -91,6 +91,19 @@ testUserConfig() {
...
@@ -91,6 +91,19 @@ testUserConfig() {
assertCapturedError 1
""
assertCapturedError 1
""
}
}
testProcfileAbsentNpmStartPresent
()
{
compile
"procfile-absent-npm-start-present"
assertCaptured
"No Procfile found; adding npm start script to Procfile"
assertFile
"web: npm start"
"Procfile"
assertCapturedSuccess
}
testProcfileAbsentNpmStartAbsent
()
{
compile
"procfile-absent-npm-start-absent"
assertCaptured
"Create a Procfile or specify a start script"
assertCapturedSuccess
}
# Pending Tests
# Pending Tests
# testNodeBinariesAddedToPath() {
# testNodeBinariesAddedToPath() {
...
...
test/procfile-absent-npm-start-absent/README.md
0 → 100644
View file @
e9266dfe
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
test/procfile-absent-npm-start-absent/package.json
0 → 100644
View file @
e9266dfe
{
"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"
},
"dependencies"
:
{
"hashish"
:
"*"
},
"engines"
:
{
"node"
:
"~0.10.0"
}
}
test/procfile-absent-npm-start-present/README.md
0 → 100644
View file @
e9266dfe
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
test/procfile-absent-npm-start-present/package.json
0 → 100644
View file @
e9266dfe
{
"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"
},
"dependencies"
:
{
"hashish"
:
"*"
},
"engines"
:
{
"node"
:
"~0.10.0"
},
"scripts"
:
{
"start"
:
"echo foo"
}
}
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