fix: properly retrieve ports list

This commit is contained in:
Jose Diaz-Gonzalez
2017-04-23 12:41:41 -06:00
committed by Michael Hobbs
parent 006eb452f1
commit 7fd32fb3e8
2 changed files with 9 additions and 8 deletions

View File

@@ -596,17 +596,19 @@ dokku_deploy_cmd() {
ports="$(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH")"
local DOKKU_DOCKER_PORT_ARGS=""
local DOKKU_PORT=""
for port in "${ports[@]}"; do
DOKKU_DOCKER_PORT_ARGS+=" -p $port "
PORTS="$port"
for p in "${ports[@]}"; do
if [[ ! "$p" =~ .*udp.* ]]; then
DOKKU_PORT=${DOKKU_PORT:="$p"}
fi
DOKKU_DOCKER_PORT_ARGS+=" -p $p "
done
if [[ "$DOKKU_IS_APP_PROXY_ENABLED" == "true" ]]; then
# shellcheck disable=SC2086
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$DOKKU_PORT $DOCKER_ARGS $IMAGE $START_CMD)
else
# shellcheck disable=SC2086
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$DOKKU_PORT $DOCKER_ARGS $IMAGE $START_CMD)
fi
else
# shellcheck disable=SC2086

View File

@@ -68,10 +68,9 @@ network-compute-container-ports() {
for p in ${DOKKU_DOCKERFILE_PORTS[*]};do
if [[ ! "$p" =~ .*udp.* ]]; then
# set port to first non-udp port
local p=${p//\/tcp}
local PORT=${PORT:="$p"}
p=${p//\/tcp}
fi
PORTS+=" $PORT "
PORTS+="$p "
done
fi