Copy/Pasta supply-config setup

This commit is contained in:
Luke Murphy
2020-03-19 23:42:53 +01:00
parent 608fc38114
commit 50b2c86429
5 changed files with 38 additions and 21 deletions

View File

@ -4,11 +4,18 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; verify_app_name "$APP"
TMP_WORK_DIR="$2"
dokku-ansible-playbook-post-extract() {
declare APP="$1" TMPDIR="$2"
pushd "$TMP_WORK_DIR" >/dev/null
dokku_col_log_info1_quiet "Checking for ansible playbooks supplied in repo"
cp -r "ansible/*" "$DOKKU_LIB_ROOT/data/ansible/$APP"
if [[ -d "$TMPDIR/ansible" ]] && [[ "$(ls -A "$TMPDIR/ansible")" ]]; then
mkout=$(mkdir -p "$DOKKU_LIB_ROOT/data/ansible/$APP")
dokku_log_verbose_quiet "$mkout"
popd >/dev/null
cpout=$(cp -r "$TMPDIR/ansible/." "$DOKKU_LIB_ROOT/data/ansible/$APP")
dokku_log_verbose_quiet "$cpout"
fi
}
dokku-ansible-playbook-post-extract "$@"