From 90ea6a5ba48509e9736313b4828a45d2660b4393 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Sat, 12 Dec 2015 12:40:33 +0100 Subject: [PATCH] Make plugin hooks send out more information Add this point you only get information that "something" happend on the given hook. By adding more information to the hook, plugin creators can do more interesting stuff. * The first params remains the $APP name (to maintain backwards compatability) * The second params sends in the action that happend, for domain this can be: "add", "clear" or "remove" * The third param sends in the argument that was passed to the original function, for domain that would be a list of all the domains that was given. One reason this addition would be great for plugin owners, is that when you have a web tool over Dokku, and someone creates a domain over the CLI, we a plugin can send back information about the event to the webapp over an API. That way the webapp is always up-to-date with the Dokku installation. Signed-off-by: Jeroen van Baarsen --- plugins/domains/commands | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/domains/commands b/plugins/domains/commands index c27807ba7..5b8c2d0fa 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -75,7 +75,7 @@ case "$1" in for DOMAIN in "$@"; do echo "$DOMAIN" >> "$DOKKU_ROOT/$APP/VHOST" done - plugn trigger post-domains-update $APP + plugn trigger post-domains-update $APP "add" "$@" for DOMAIN in "$@"; do dokku_log_info1 "Added $DOMAIN to $APP" done @@ -89,7 +89,7 @@ case "$1" in rm -f "$DOKKU_ROOT/$APP/VHOST" dokku domains:setup $APP - plugn trigger post-domains-update $APP + plugn trigger post-domains-update $APP "clear" dokku_log_info1 "Cleared domains in $APP" ;; @@ -110,7 +110,7 @@ case "$1" in for DOMAIN in "$@"; do sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST" done - plugn trigger post-domains-update $APP + plugn trigger post-domains-update $APP "remove" "$@" for DOMAIN in "$@"; do dokku_log_info1 "Removed $DOMAIN from $APP" done