refactor: standardize trigger code
This commit is contained in:
@@ -4,12 +4,12 @@ set -eo pipefail
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_app_restart() {
|
||||
trigger-ps-app-restart() {
|
||||
declare desc="ps app-restart plugin trigger"
|
||||
local trigger="ps_app_restart"
|
||||
local APP="$1"
|
||||
declare trigger="app-restart"
|
||||
declare APP="$1"
|
||||
|
||||
ps_restart "$APP"
|
||||
}
|
||||
|
||||
ps_app_restart "$@"
|
||||
trigger-ps-app-restart "$@"
|
||||
|
||||
@@ -5,13 +5,13 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_core_post_deploy() {
|
||||
trigger-ps-core-post-deploy() {
|
||||
declare desc="ps core-post-deploy plugin trigger"
|
||||
local trigger="ps_core_post_deploy"
|
||||
local APP="$1"
|
||||
declare trigger="core-post-deploy"
|
||||
declare APP="$1"
|
||||
|
||||
remove_procfile "$APP"
|
||||
DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_RESTORE=1
|
||||
}
|
||||
|
||||
ps_core_post_deploy "$@"
|
||||
trigger-ps-core-post-deploy "$@"
|
||||
|
||||
@@ -7,6 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
trigger-ps-install() {
|
||||
declare desc="set the default restart policy for all applications if there is not one already set"
|
||||
declare trigger="install"
|
||||
local APPS="$(dokku_apps)"
|
||||
local APP
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_post_create() {
|
||||
trigger-ps-post-create() {
|
||||
declare desc="ps post-create plugin trigger"
|
||||
local trigger="ps_post_create"
|
||||
declare trigger="post-create"
|
||||
local APP="$1"
|
||||
|
||||
local passed_phases=(deploy)
|
||||
add_passed_docker_option passed_phases[@] "--restart=on-failure:10"
|
||||
}
|
||||
|
||||
ps_post_create "$@"
|
||||
trigger-ps-post-create "$@"
|
||||
|
||||
@@ -5,12 +5,12 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_post_stop() {
|
||||
trigger-ps-post-stop() {
|
||||
declare desc="ps post-stop plugin trigger"
|
||||
local trigger="ps_post_stop"
|
||||
local APP="$1"
|
||||
declare trigger="post-stop"
|
||||
declare APP="$1"
|
||||
|
||||
DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_RESTORE=0
|
||||
}
|
||||
|
||||
ps_post_stop "$@"
|
||||
trigger-ps-post-stop "$@"
|
||||
|
||||
@@ -4,14 +4,13 @@ set -eo pipefail
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_pre_deploy() {
|
||||
trigger-ps-pre-deploy() {
|
||||
declare desc="ps pre-deploy plugin trigger"
|
||||
local trigger="ps_pre_deploy"
|
||||
local APP="$1"
|
||||
local IMAGE_TAG="$2"
|
||||
declare trigger="pre-deploy"
|
||||
declare APP="$1" IMAGE_TAG="$2"
|
||||
|
||||
extract_procfile "$APP" "$IMAGE_TAG"
|
||||
generate_scale_file "$APP" "$IMAGE_TAG"
|
||||
}
|
||||
|
||||
ps_pre_deploy "$@"
|
||||
trigger-ps-pre-deploy "$@"
|
||||
|
||||
Reference in New Issue
Block a user