feat: add a new plugin trigger for detecting what the current deployment method is

This is currently used solely for reporting.

Closes #3047
This commit is contained in:
Jose Diaz-Gonzalez
2018-03-03 18:16:50 -05:00
parent be79060d7e
commit c9d9750afe
7 changed files with 76 additions and 8 deletions

21
plugins/git/deploy-method Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
git_deploy_method() {
declare desc="git deploy-method plugin trigger"
declare trigger="git_deploy_method"
declare APP="$1"
local STDIN=$(cat)
# bail if another method is detected
if [[ -n "$STDIN" ]]; then
echo "$STDIN"
return
fi
if [[ -d "$DOKKU_ROOT/$APP/refs" ]]; then
echo "git"
fi
}
git_deploy_method "$@"