refactor: deprecate git_deploy_branch in favor of plugn trigger

This commit is contained in:
Jose Diaz-Gonzalez
2020-04-18 18:21:46 -04:00
parent 74e147005b
commit a8a6d0595b
5 changed files with 56 additions and 13 deletions

View File

@@ -69,3 +69,18 @@ cmd-git-report-single() {
[[ "$value_exists" == "true" ]] || dokku_log_fail "not deployed"
fi
}
fn-git-deploy-branch() {
declare desc="retrieve the deploy branch for a given application"
local APP="$1"
local DOKKU_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "$APP" "deploy-branch" "")"
local DOKKU_GLOBAL_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "--global" "deploy-branch" "")"
if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then
echo "$DOKKU_DEPLOY_BRANCH"
elif [[ -n "$DOKKU_GLOBAL_DEPLOY_BRANCH" ]]; then
echo "$DOKKU_GLOBAL_DEPLOY_BRANCH"
else
echo "master"
fi
}