This repository has been archived on 2020-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-deploy/post-extract

26 lines
837 B
Plaintext
Raw Normal View History

2020-04-07 14:10:31 +00:00
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku-ansible-deploy-post-extract() {
declare APP="$1" TMPDIR="$2"
if [[ -d "$TMPDIR/deploy.d" ]] && [[ "$(ls -A "$TMPDIR/deploy.d")" ]]; then
dokku_col_log_info1_quiet "Copying deploy.d files into place"
mkdir -p "$DOKKU_LIB_ROOT/data/deploy.d/$APP"
cp -r "$TMPDIR/deploy.d/." "$DOKKU_LIB_ROOT/data/deploy.d/$APP"
if [[ -d "$TMPDIR/deploy.d/vault" ]]; then
if [[ ! -f "$DOKKU_LIB_ROOT/data/deploy.d/$APP/.vault-password.sh" ]]; then
dokku_col_log_info1_quiet "Vault folder discovered but missing vault password"
dokku_col_log_info1_quiet "please run dokku dokku-deploy:vault-password $APP"
exit 1
fi
fi
fi
}
dokku-ansible-deploy-post-extract "$@"