refactor: move app.json script execution into it's own plugin
Rather than have this live in 00_dokku-standard, move it out so that it may start to support various other features around the app.json manifest.
This commit is contained in:
18
plugins/app-json/pre-deploy
Executable file
18
plugins/app-json/pre-deploy
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/app-json/internal-functions"
|
||||
|
||||
app_json_pre_deploy() {
|
||||
declare desc="app-json scripts execution"
|
||||
local trigger="app_json_pre_deploy"
|
||||
local APP="$1"
|
||||
local IMAGE_TAG="$2"
|
||||
local PHASE_SCRIPT_KEY="predeploy"
|
||||
|
||||
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
||||
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
||||
}
|
||||
|
||||
app_json_pre_deploy "$@"
|
||||
Reference in New Issue
Block a user