feat: add ability to trigger an arbitrary plugin hook

This is useful in cases where the command output must be tested, but it is otherwise embedded in a specific part of the dokku core.
As the 'plugin' commands require root, this is safe to add to the core.
This commit is contained in:
Jose Diaz-Gonzalez
2019-05-13 16:05:27 -04:00
parent ba3af25423
commit 0cf03baa78
3 changed files with 19 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
plugin_trigger_cmd() {
declare desc="trigger an arbitrary plugin hook"
local cmd="plugin:trigger"
[[ "$1" == "$cmd" ]] && shift 1
plugn trigger "$@"
}
plugin_trigger_cmd "$@"