refactor: move code that fetches raw tcp ports for dockerfile deploys to ports plugin

This commit is contained in:
Jose Diaz-Gonzalez
2023-07-09 02:26:16 -04:00
parent bdf0b6c509
commit 121e4737a8
10 changed files with 75 additions and 19 deletions

View File

@@ -815,18 +815,10 @@ extract_directive_from_dockerfile() {
get_app_raw_tcp_ports() {
declare desc="extracts raw tcp port numbers from DOCKERFILE_PORTS config variable"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
declare APP="$1"
local APP="$1"
local DOCKERFILE_PORTS="$(config_get "$APP" DOKKU_DOCKERFILE_PORTS)"
for p in $DOCKERFILE_PORTS; do
if [[ ! "$p" =~ .*udp.* ]]; then
p=${p//\/tcp/}
raw_tcp_ports+="$p "
fi
done
local raw_tcp_ports="$(echo "$raw_tcp_ports" | xargs)"
echo "$raw_tcp_ports"
dokku_log_warn "Deprecated: this function should not be used in app code"
plugn trigger ports-dockerfile-raw-tcp-ports "$APP" | xargs
}
get_container_ports() {