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:
@@ -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: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 `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 `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.
|
||||||
|
|||||||
@@ -1496,7 +1496,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
|
|
||||||
- Description: Fetches the command for a specific process type
|
- Description: Fetches the command for a specific process type
|
||||||
- Invoked by: `internally`
|
- Invoked by: `internally`
|
||||||
- Arguments: `$APP $PROCESS_TYPE $PORT $PROCFILE_PATH`
|
- Arguments: `$APP $PROCESS_TYPE $PORT`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func main() {
|
|||||||
processType := flag.Arg(1)
|
processType := flag.Arg(1)
|
||||||
port := common.ToInt(flag.Arg(2), 5000)
|
port := common.ToInt(flag.Arg(2), 5000)
|
||||||
procfilePath := flag.Arg(3)
|
procfilePath := flag.Arg(3)
|
||||||
err = ps.TriggerProcfileGetCommand(appName, processType, port, procfilePath)
|
err = ps.TriggerProcfileGetCommand(appName, processType, port)
|
||||||
case "procfile-remove":
|
case "procfile-remove":
|
||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
procfilePath := flag.Arg(1)
|
procfilePath := flag.Arg(1)
|
||||||
|
|||||||
@@ -162,11 +162,8 @@ func TriggerProcfileExtract(appName string, image string, forceExtract bool, pro
|
|||||||
return extractProcfile(appName, image, procfilePath)
|
return extractProcfile(appName, image, procfilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TriggerProcfileGetCommand(appName string, processType string, port int, procfilePath string) error {
|
func TriggerProcfileGetCommand(appName string, processType string, port int) error {
|
||||||
if procfilePath == "" {
|
procfilePath := getProcfilePath(appName)
|
||||||
procfilePath = getProcfilePath(appName)
|
|
||||||
}
|
|
||||||
|
|
||||||
command, err := getProcfileCommand(procfilePath, processType, port)
|
command, err := getProcfileCommand(procfilePath, processType, port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ teardown() {
|
|||||||
web: node web.js --port \$PORT
|
web: node web.js --port \$PORT
|
||||||
worker: node worker.js
|
worker: node worker.js
|
||||||
EOF
|
EOF
|
||||||
run get_cmd_from_procfile "$TEST_APP" web 5001
|
run plugn trigger procfile-get-command "$TEST_APP" web 5001
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output "node web.js --port 5001"
|
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 "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output "node worker.js"
|
assert_output "node worker.js"
|
||||||
|
|||||||
Reference in New Issue
Block a user