Add common functions

This commit is contained in:
Luke Murphy 2020-03-19 23:45:06 +01:00
parent 50b2c86429
commit b5eb80147a
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
4 changed files with 17 additions and 5 deletions

View File

@ -2,9 +2,15 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
export DEBIAN_FRONTEND=noninteractive
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
if ! command -v "ansible" &>/dev/null; then
dokku-ansible-playbook-dependencies() {
export DEBIAN_FRONTEND=noninteractive
if ! command -v "ansible" &>/dev/null; then
dokku_col_log_info1_quiet "installing ansible"
apt install -qq -y ansible
fi
fi
}
dokku-ansible-playbook-dependencies "$@"

View File

@ -2,6 +2,8 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
function run_playbook() {
local play_path="$1"
local requirements="$2"

View File

@ -2,6 +2,8 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku-ansible-playbook-post-deploy() {
declare APP="$1"
declare PLAYBOOK="$DOKKU_LIB_ROOT/data/ansible/$APP/post-deploy.yml"

View File

@ -2,6 +2,8 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku-ansible-playbook-pre-deploy() {
declare APP="$1"
declare PLAYBOOK="$DOKKU_LIB_ROOT/data/ansible/$APP/pre-deploy.yml"