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