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

23 lines
781 B
Plaintext
Raw Normal View History

2020-03-19 22:29:59 +00:00
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
2020-03-19 22:42:53 +00:00
dokku-ansible-playbook-post-extract() {
declare APP="$1" TMPDIR="$2"
2020-03-19 22:29:59 +00:00
2020-03-19 22:42:53 +00:00
dokku_col_log_info1_quiet "Checking for ansible playbooks supplied in repo"
if [[ -d "$TMPDIR/ansible" ]] && [[ "$(ls -A "$TMPDIR/ansible")" ]]; then
2020-03-19 22:47:05 +00:00
mkdir -p "$DOKKU_LIB_ROOT/data/ansible/$APP"
2020-03-21 00:49:08 +00:00
cp -r "$TMPDIR/ansible/." "$DOKKU_LIB_ROOT/data/ansible/$APP"
2020-03-21 00:22:21 +00:00
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
2020-03-19 22:42:53 +00:00
fi
}
dokku-ansible-playbook-post-extract "$@"