refactor: standardize trigger code

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-10 02:40:59 -05:00
parent 4a60497d3e
commit 7357579af2
63 changed files with 382 additions and 329 deletions

View File

@@ -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 "$@"

View File

@@ -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")"

View File

@@ -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 "$@"

View File

@@ -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"
}