Add commands definition

This commit is contained in:
Luke Murphy 2020-04-07 16:52:18 +02:00
parent 410999242d
commit e8b77a4f4f
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 42 additions and 1 deletions

View File

@ -1 +1,42 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " help ansible-deploy:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
help | ansible-deploy:help)
help_content_func() {
#shellcheck disable=SC2034
declare desc="return ansible-deploy plugin help content"
cat<<help_content
ansible-deploy:vault-pass, Add new app vault password for decryption of passwords
help_content
}
if [[ $1 = "ansible-deploy:help" ]]; then
echo -e 'Usage: dokku ansible-deploy:COMMAND'
echo ''
echo 'Deploy applications on Dokku using Ansible'
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-deploy, Deploy applications on Dokku using Ansible.
help_desc
fi
;;
vault-pass)
dokku-ansible-deploy-vault-pass-cmd "$@"
;;
*)
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
;;
esac

View File

@ -12,7 +12,7 @@ dokku-ansible-deploy-validate-dependencies() {
dokku-ansible-deploy-vault-pass-cmd() { dokku-ansible-deploy-vault-pass-cmd() {
#shellcheck disable=SC2034 #shellcheck disable=SC2034
declare desc="insert new application vault password for decryption of passwords" declare desc="add new app vault password for decryption of passwords"
local app="$1" local app="$1"
local vault_file="$DOKKU_LIB_ROOT/data/deploy.d/$app/.vault-password.sh" local vault_file="$DOKKU_LIB_ROOT/data/deploy.d/$app/.vault-password.sh"