#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku-ansible-playbook-post-extract() {
declare APP="$1" TMPDIR="$2"
dokku_col_log_info1_quiet "Checking for ansible playbooks supplied in repo"
if [[ -d "$TMPDIR/ansible" ]] && [[ "$(ls -A "$TMPDIR/ansible")" ]]; then
mkout=$(mkdir -p "$DOKKU_LIB_ROOT/data/ansible/$APP")
dokku_log_verbose_quiet "$mkout"
cpout=$(cp -r "$TMPDIR/ansible/." "$DOKKU_LIB_ROOT/data/ansible/$APP")
dokku_log_verbose_quiet "$cpout"
fi
}
dokku-ansible-playbook-post-extract "$@"