update APP_PARAMETERS only for non-empty env vars

This commit is contained in:
Axel Uhl
2022-01-18 23:48:46 +01:00
parent 674de4e7a2
commit 02b76df524
+15 -1
View File
@@ -726,7 +726,21 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
# make sure to honour the service configuration
# needed to make sure that tests use the right servers
APP_PARAMETERS="-Dmongo.host=$MONGODB_HOST -Dmongo.port=$MONGODB_PORT -Dexpedition.udp.port=$EXPEDITION_PORT -Dreplication.exchangeHost=$REPLICATION_HOST -Dreplication.exchangeName=$REPLICATION_CHANNEL ${APP_PARAMETERS}"
if [ -n "${MONGODB_HOST}" ]; then
APP_PARAMETERS="-Dmongo.host=${MONGODB_HOST} ${APP_PARAMETERS}"
fi
if [ -n "${MONGODB_PORT}" ]; then
APP_PARAMETERS="-Dmongo.port=${MONGODB_PORT} ${APP_PARAMETERS}"
fi
if [ -n "${EXPEDITION_PORT}" ]; then
APP_PARAMETERS="-Dexpedition.udp.port=${EXPEDITION_PORT} ${APP_PARAMETERS}"
fi
if [ -n "${REPLICATION_HOST}" ]; then
APP_PARAMETERS="-Dreplication.exchangeHost=${REPLICATION_HOST} ${APP_PARAMETERS}"
fi
if [ -n "${REPLICATION_CHANNEL}" ]; then
APP_PARAMETERS="-Dreplication.exchangeName=${REPLICATION_CHANNEL} ${APP_PARAMETERS}"
fi
extra="$extra -P with-not-android-relevant,!with-mobile"