refactor: move external procfile manipulation into triggers
This also cleans up the internal APIs a bit.
This commit is contained in:
19
plugins/ps/procfile-get-command
Executable file
19
plugins/ps/procfile-get-command
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
trigger-ps-procfile-get-command() {
|
||||
declare desc="ps procfile-get-command plugin trigger"
|
||||
declare trigger="procfile-get-command"
|
||||
declare desc="extract command from an app procfile"
|
||||
declare APP="$1" PROCESS_TYPE="$2" PORT="$3" "$PROCFILE_PATH"
|
||||
|
||||
if [[ -z "$PROCFILE_PATH" ]]; then
|
||||
PROCFILE_PATH="$DOKKU_LIB_ROOT/data/ps/$APP/Procfile.extracted"
|
||||
fi
|
||||
|
||||
fn-procfile-get-command "$PROCFILE_PATH" "$PROCESS_TYPE" "$PORT"
|
||||
}
|
||||
|
||||
trigger-ps-procfile-get-command "$@"
|
||||
Reference in New Issue
Block a user