This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-playbook/post-extract
2020-03-21 01:49:08 +01:00

23 lines
781 B
Bash
Executable File

#!/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
mkdir -p "$DOKKU_LIB_ROOT/data/ansible/$APP"
cp -r "$TMPDIR/ansible/." "$DOKKU_LIB_ROOT/data/ansible/$APP"
if [[ -f "$TMPDIR/ansible/.vault.sh" ]]; then
dokku_col_log_info1_quiet "Moving vault password file into place"
cp -r "$TMPDIR/ansible/.vault.sh" "$DOKKU_LIB_ROOT/data/ansible/$APP"
chmod 600 "$DOKKU_LIB_ROOT/data/ansible/$APP/.vault.sh"
fi
fi
}
dokku-ansible-playbook-post-extract "$@"