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")" ports="$(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH")"
local DOKKU_DOCKER_PORT_ARGS="" local DOKKU_DOCKER_PORT_ARGS=""
local DOKKU_PORT="" local DOKKU_PORT=""
for port in "${ports[@]}"; do for p in "${ports[@]}"; do
DOKKU_DOCKER_PORT_ARGS+=" -p $port " if [[ ! "$p" =~ .*udp.* ]]; then
PORTS="$port" DOKKU_PORT=${DOKKU_PORT:="$p"}
fi
DOKKU_DOCKER_PORT_ARGS+=" -p $p "
done done
if [[ "$DOKKU_IS_APP_PROXY_ENABLED" == "true" ]]; then if [[ "$DOKKU_IS_APP_PROXY_ENABLED" == "true" ]]; then
# shellcheck disable=SC2086 # 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 else
# shellcheck disable=SC2086 # 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 fi
else else
# shellcheck disable=SC2086 # shellcheck disable=SC2086

View File

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