Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Excluding release from start unless explict (#23)
Browse files Browse the repository at this point in the history
* Excluding release from start unless explict

* Add co dependency & plugins:link for CI

* Add `npm install` before trying to link
  • Loading branch information
Ransom Briggs authored Jun 20, 2016
1 parent 1f9e1c7 commit 3b505cd
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
web: echo "it works (web)! port: $PORT"
worker: echo "it works (worker)!"
release: echo "it works (release)!"
4 changes: 4 additions & 0 deletions Procfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
web: echo "it works (web)! port: $PORT"
worker: echo "it works (worker)!"
test: echo "it works (test)!"
release: echo "it works (release)!"
2 changes: 2 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ dependencies:
- sudo add-apt-repository ppa:duggan/bats -y
- sudo apt-get update
- sudo apt-get install bats
- npm install
- heroku plugins:link .
9 changes: 8 additions & 1 deletion commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ function * run (context) {
if (context.flags.procfile) process.argv.push('--procfile', context.flags.procfile)
if (context.flags.env) process.argv.push('--env', context.flags.env)
if (context.flags.port) process.argv.push('--port', context.flags.port)
if (context.args.processname) process.argv.push(context.args.processname)
if (context.args.processname) {
process.argv.push(context.args.processname)
} else {
let procfile = context.flags.procfile || 'Procfile'
let procHash = require('foreman/lib/procfile.js').loadProc(procfile)
let processes = Object.keys(procHash).filter((x) => x !== 'release')
process.argv.push(processes.join(','))
}

require('foreman/nf.js')
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"url": "https://github.com/heroku/heroku-local/issues"
},
"dependencies": {
"co": "4.6.0",
"foreman": "2.0.0-1",
"heroku-cli-util": "6.0.11"
},
Expand Down
21 changes: 21 additions & 0 deletions test/start.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,24 @@ setup() {
[ "$status" -eq 0 ]
[[ "$output" =~ "it works (web)!" ]]
}

@test "start includes just web & worker" {
run heroku local
echo $output
[ "$status" -eq 0 ]
[[ "$output" =~ "it works (web)!" ]] && [[ "$output" =~ "it works (worker)!" ]] && [[ ! "$output" =~ "it works (release)!" ]]
}

@test "start -f Procfile.test includes just web & worker & test" {
run heroku local -f Procfile.test
echo $output
[ "$status" -eq 0 ]
[[ "$output" =~ "it works (web)!" ]] && [[ "$output" =~ "it works (worker)!" ]] && [[ "$output" =~ "it works (test)!" ]] && [[ ! "$output" =~ "it works (release)!" ]]
}

@test "start release includes release" {
run heroku local release
echo $output
[ "$status" -eq 0 ]
[[ "$output" =~ "it works (release)!" ]]
}

0 comments on commit 3b505cd

Please sign in to comment.