initial pass at implementing DOKKU_PROXY_PORT_MAP. closes #2239.

This commit is contained in:
Michael Hobbs committed 2016-06-16 16:04:44 -07:00
1 parent 99c56ccd6d
commit 6c1d6225f9
33 files changed
+472 -207

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
proxy_ports_add_cmd() {
declare desc="add proxy port mappings from an app"
local cmd="proxy:add"
local APP="$2"; verify_app_name "$APP"
local PROXY_PORT_MAP="$(config_get "$APP" DOKKU_PROXY_PORT_MAP || true)"
shift 2
local INPUT_PORTS="$*"
if [[ -n "$INPUT_PORTS" ]]; then
PROXY_PORT_MAP="$(merge_dedupe_list "$PROXY_PORT_MAP $INPUT_PORTS" " ")"
config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP"
else
dokku proxy:help
dokku_log_fail "No port mapping specified. Exiting..."
fi
plugn trigger post-proxy-ports-update "$APP" "add"
}
proxy_ports_add_cmd "$@"