Commit edf4c8e7 authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for dynamically-created Procfile support

parent f8632a74
...@@ -153,6 +153,8 @@ head "Checking startup method" ...@@ -153,6 +153,8 @@ head "Checking startup method"
if [ "$start_method" == "Procfile" ]; then if [ "$start_method" == "Procfile" ]; then
info "Found Procfile" info "Found Procfile"
elif test -f $build_dir/Procfile; then
info "Procfile created during build"
elif [ "$start_method" == "npm start" ]; then elif [ "$start_method" == "npm start" ]; then
info "No Procfile; Adding 'web: npm start' to new Procfile" info "No Procfile; Adding 'web: npm start' to new Procfile"
echo "web: npm start" > $build_dir/Procfile echo "web: npm start" > $build_dir/Procfile
......
...@@ -7,6 +7,12 @@ testDetectWithPackageJson() { ...@@ -7,6 +7,12 @@ testDetectWithPackageJson() {
assertCapturedSuccess assertCapturedSuccess
} }
testDetectWithServer() {
detect "server-present-only"
assertCaptured "Node.js"
assertCapturedSuccess
}
testDetectWithoutPackageJson() { testDetectWithoutPackageJson() {
detect "no-package-json" detect "no-package-json"
assertCapturedError 1 "" assertCapturedError 1 ""
...@@ -143,6 +149,13 @@ testProcfileAbsentNpmStartAbsent() { ...@@ -143,6 +149,13 @@ testProcfileAbsentNpmStartAbsent() {
assertCapturedSuccess assertCapturedSuccess
} }
testDynamicProcfile() {
compile "dynamic-procfile"
assertCaptured "Procfile created during build"
assertFileContains "web: node index.js customArg" "${compile_dir}/Procfile"
assertCapturedSuccess
}
testProcfileAbsentServerPresent() { testProcfileAbsentServerPresent() {
compile "procfile-absent-server-present" compile "procfile-absent-server-present"
assertCaptured "Start mechanism: server.js" assertCaptured "Start mechanism: server.js"
......
{
"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.x"
},
"scripts": {
"postinstall": "echo 'web: node index.js customArg' > Procfile"
}
}
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