refactor: drop the last argument from procfile-get-command

No external plugin should need to know the internals of where processes are.
This commit is contained in:
Jose Diaz-Gonzalez
2020-11-01 17:30:24 -05:00
parent e8cfbfad36
commit ab1d15216c
5 changed files with 7 additions and 9 deletions

View File

@@ -17,3 +17,4 @@ The `ps` command has had a few removals as a result of a rewrite to Golang:
- The `ps:stopall` command has been removed in favor of calling the `ps:stop` with the `--all` flag instead of an app name.
- The `ps:startall` command has been removed in favor of calling the `ps:start` with the `--all` flag instead of an app name.
- The `DOKKU_PROCFILE` file is no longer located in the git directory for a given app on the server. It's location is currently not exposed.
- The `procfile-get-command` plugin trigger no longer takes a `procfile path` as the final argument.

View File

@@ -1496,7 +1496,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
- Description: Fetches the command for a specific process type
- Invoked by: `internally`
- Arguments: `$APP $PROCESS_TYPE $PORT $PROCFILE_PATH`
- Arguments: `$APP $PROCESS_TYPE $PORT`
- Example:
```shell

View File

@@ -62,7 +62,7 @@ func main() {
processType := flag.Arg(1)
port := common.ToInt(flag.Arg(2), 5000)
procfilePath := flag.Arg(3)
err = ps.TriggerProcfileGetCommand(appName, processType, port, procfilePath)
err = ps.TriggerProcfileGetCommand(appName, processType, port)
case "procfile-remove":
appName := flag.Arg(0)
procfilePath := flag.Arg(1)

View File

@@ -162,11 +162,8 @@ func TriggerProcfileExtract(appName string, image string, forceExtract bool, pro
return extractProcfile(appName, image, procfilePath)
}
func TriggerProcfileGetCommand(appName string, processType string, port int, procfilePath string) error {
if procfilePath == "" {
procfilePath = getProcfilePath(appName)
}
func TriggerProcfileGetCommand(appName string, processType string, port int) error {
procfilePath := getProcfilePath(appName)
command, err := getProcfileCommand(procfilePath, processType, port)
if err != nil {
return err

View File

@@ -44,12 +44,12 @@ teardown() {
web: node web.js --port \$PORT
worker: node worker.js
EOF
run get_cmd_from_procfile "$TEST_APP" web 5001
run plugn trigger procfile-get-command "$TEST_APP" web 5001
echo "output: $output"
echo "status: $status"
assert_output "node web.js --port 5001"
run get_cmd_from_procfile "$TEST_APP" worker
run plugn trigger procfile-get-command "$TEST_APP" worker
echo "output: $output"
echo "status: $status"
assert_output "node worker.js"