refactor: standardize trigger code
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
git_deploy_source() {
|
||||
trigger-git-deploy-source() {
|
||||
declare desc="git deploy-source plugin trigger"
|
||||
declare trigger="git_deploy_source"
|
||||
declare trigger="deploy-source"
|
||||
declare APP="$1"
|
||||
local STDIN
|
||||
STDIN=$(cat)
|
||||
@@ -20,4 +20,4 @@ git_deploy_source() {
|
||||
fi
|
||||
}
|
||||
|
||||
git_deploy_source "$@"
|
||||
trigger-git-deploy-source "$@"
|
||||
|
||||
@@ -6,6 +6,7 @@ set -eo pipefail
|
||||
|
||||
trigger-git-git-revision() {
|
||||
declare desc="fetches the current git revision value for an application"
|
||||
declare trigger="git-revision"
|
||||
declare APP="$1"
|
||||
|
||||
ENV_VAR_NAME="$(fn-plugin-property-get "git" "$APP" "rev-env-var")"
|
||||
|
||||
@@ -7,7 +7,10 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
trigger-git-install() {
|
||||
declare desc="installs the git plugin"
|
||||
declare trigger="install"
|
||||
|
||||
fn-plugin-property-setup "git"
|
||||
migrate_git_vars_0_12_0 "$@"
|
||||
}
|
||||
|
||||
migrate_git_vars_0_12_0() {
|
||||
@@ -31,4 +34,3 @@ migrate_git_vars_0_12_0() {
|
||||
}
|
||||
|
||||
trigger-git-install "$@"
|
||||
migrate_git_vars_0_12_0 "$@"
|
||||
|
||||
@@ -5,7 +5,9 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
|
||||
|
||||
trigger-git-post-delete() {
|
||||
declare desc="destroys the git properties for a given app"
|
||||
declare trigger="post-delete"
|
||||
declare APP="$1"
|
||||
|
||||
fn-plugin-property-destroy "git" "$APP"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user