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/commands
2020-03-22 00:33:12 +01:00

43 lines
991 B
Bash
Executable File

#!/usr/bin/env bash
[[ " help ansible:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
help | ansible:help)
help_content_func() {
#shellcheck disable=SC2034
declare desc="return ansible-playbook plugin help content"
cat<<help_content
ansible:vault-pass, Insert new vault password for encrypt/decrypt of passwords
help_content
}
if [[ $1 = "ansible:help" ]]; then
echo -e 'Usage: dokku ansible:COMMAND'
echo ''
echo 'Run ansible playbooks during deployment'
echo ''
echo 'Commands:'
help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
help_content_func
else
cat<<help_desc
ansible, Run ansible playbooks during deployment
help_desc
fi
;;
vault-pass)
dokku-ansible-playbook-vault-pass-cmd "$@"
;;
*)
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
;;
esac