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

@@ -849,8 +849,7 @@ internal_get_app_urls() {
declare desc="print an app's available urls"
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
local APP="$2"
local RAW_TCP_PORTS="$(get_app_raw_tcp_ports "$APP")"
local URLS_FILE="$DOKKU_ROOT/$APP/URLS"
@@ -860,7 +859,7 @@ internal_get_app_urls() {
local app_urls="$(grep -v -E "^#" "$URLS_FILE")"
if [[ -n "$DOKKU_PROXY_PORT_MAP" ]]; then
local port_map app_vhost
local app_vhosts=$(get_app_domains "$APP")
local app_vhosts=$(plugn trigger domains-list "$APP")
for port_map in $DOKKU_PROXY_PORT_MAP; do
local scheme="$(awk -F ':' '{ print $1 }' <<<"$port_map")"
local listen_port="$(awk -F ':' '{ print $2 }' <<<"$port_map")"