refactor: move domain manipulation into triggers

This allows other plugins to avoid understanding the underlying details of how domains might be integrated with.
This commit is contained in:
Jose Diaz-Gonzalez
2020-05-06 00:16:51 -04:00
parent 5458d5b341
commit 61a306664f
22 changed files with 226 additions and 49 deletions

View File

@@ -2,7 +2,6 @@
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
trigger-nginx-vhosts-core-post-deploy() {
@@ -17,12 +16,7 @@ trigger-nginx-vhosts-core-post-deploy() {
HAS_NETWORK_CONFIG="$(plugn trigger network-config-exists "$APP")"
if [[ "$HAS_NETWORK_CONFIG" == "true" ]]; then
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
dokku_log_info1 "VHOST support disabled. Skipping domains setup"
elif [[ ! -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
domains_setup "$APP"
fi
plugn trigger domains-setup "$APP"
nginx_build_config "$APP"
fi
}