Files
dokku/plugins/git/install
Jose Diaz-Gonzalez d67e883e13 feat: flesh out git plugin further
- add `report` and `set` subcommands to the git plugin
- move configuring the DOKKU_DEPLOY_BRANCH to the git plugin
- implement configurable GIT_REV support
- migrate DOKKU_DEPLOY_BRANCH settings
- add a golang-compatible, shell based method of setting plugin configuration variables

Deprecates the community dokku-git-rev plugin.

Closes #2621
Refs dokku-community/dokku-git-rev#9
2018-03-31 03:25:03 -04:00

34 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-git-install() {
declare desc="installs the git plugin"
fn-plugin-property-setup "git"
}
migrate_git_vars_0_12_0() {
declare desc="migrates git config variables from 0.11.x"
local APPS="$(dokku_apps)"
local DOKKU_DEPLOY_BRANCH app
DOKKU_DEPLOY_BRANCH=$(config_get --global DOKKU_DEPLOY_BRANCH || true)
if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then
fn-plugin-property-write "git" --global "deploy-branch" "$DOKKU_DEPLOY_BRANCH"
config_unset --global DOKKU_DEPLOY_BRANCH || true
fi
for app in $APPS; do
DOKKU_DEPLOY_BRANCH=$(config_get "$app" DOKKU_DEPLOY_BRANCH || true)
if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then
fn-plugin-property-write "git" "$APP" "deploy-branch" "$DOKKU_DEPLOY_BRANCH"
config_unset --no-restart "$app" DOKKU_DEPLOY_BRANCH || true
fi
done
}
trigger-git-install "$@"
migrate_git_vars_0_12_0 "$@"