initial pass at switching to plugn

This commit is contained in:
Michael Hobbs
2015-06-12 18:07:08 -07:00
committed by Jose Diaz-Gonzalez
parent ac75c726ad
commit 7a545759f2
33 changed files with 163 additions and 91 deletions

View File

@@ -57,7 +57,7 @@ case "$1" in
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
dokku_log_info1 "Creating new $VHOST_PATH..."
SUBDOMAIN=${APP/%\.${VHOST}/}
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
hostname=$(: | plugn trigger nginx-hostname $APP $SUBDOMAIN $VHOST)
if [[ ! -n $hostname ]]; then
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
hostname="${APP/\//-}"
@@ -95,7 +95,7 @@ case "$1" in
done
# we need to restart the app to make sure we're binding to the appropriate network interface
dokku nginx:build-config $APP
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
for DOMAIN in "$@";do
dokku_log_info1 "Added $DOMAIN to $APP"
done
@@ -109,7 +109,7 @@ case "$1" in
rm -f "$DOKKU_ROOT/$APP/VHOST"
dokku domains:setup $APP
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
dokku_log_info1 "Cleared domains in $APP"
;;
@@ -130,7 +130,7 @@ case "$1" in
for DOMAIN in "$@";do
sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST"
done
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
for DOMAIN in "$@";do
dokku_log_info1 "Removed $DOMAIN from $APP"
done
@@ -138,7 +138,7 @@ case "$1" in
;;
help | domains:help)
cat && cat<<EOF
cat<<EOF
domains <app>, List custom domains for app
domains:add <app> DOMAIN, Add a custom domain to app
domains:clear <app>, Clear all custom domains for app

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.4.0"
[plugin.config]