2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-22 02:02:14 +00:00

Update sbt script to allow for debugging [ci skip]

This commit is contained in:
Ryan Emerle 2022-02-07 14:47:18 -05:00
parent 74bde4381e
commit 43886deee9
No known key found for this signature in database
GPG Key ID: C0D34C592AED41CE

View File

@ -7,10 +7,12 @@ usage() {
echo "USAGE: sbt.sh [options]"
echo -e "\t-d, --debug enable debugging"
echo -e "\t-p, --debug-port the debug port (default: 5021)"
echo -e "\t-e, --expose expose one or more ports using the Docker format for exposing ports"
}
DEBUG_SETTINGS=""
DEBUG_PORT=5021
EXPOSE_PORTS=""
while [[ $# -gt 0 ]]; do
case "$1" in
--debug | -d)
@ -22,6 +24,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
--expose | -e)
EXPOSE_PORTS="${EXPOSE_PORTS} -p \"$2\""
shift
shift
;;
*)
usage
exit 1
@ -30,8 +37,13 @@ while [[ $# -gt 0 ]]; do
done
if [ "${DEBUG_SETTINGS}" != "" ]; then
DEBUG_SETTINGS="${DEBUG_SETTINGS},address=${DEBUG_PORT}\" -p \"${DEBUG_PORT}:${DEBUG_PORT}\""
DEBUG_SETTINGS="${DEBUG_SETTINGS},address=${DEBUG_PORT}\""
# If given a debug port outside of the default range, expose the selected port
if [[ "$DEBUG_PORT" -lt 5020 ]] || [[ "$DEBUG_PORT" -gt 5030 ]]; then
DEBUG_SETTINGS="${DEBUG_SETTINGS} -p \"${DEBUG_PORT}:${DEBUG_PORT}\""
fi
fi
cd "$DIR/../test/api/integration"
make build DOCKER_PARAMS="--build-arg SKIP_API_BUILD=true" && make run-local WITH_ARGS="sbt" DOCKER_PARAMS="-p \"5020-5030:5020-5030\" ${DEBUG_SETTINGS} -e RUN_SERVICES=none --env-file \"$DIR/../test/api/integration/.env.integration\""
make build DOCKER_PARAMS="--build-arg SKIP_API_BUILD=true" && make run-local WITH_ARGS="sbt" DOCKER_PARAMS="-p \"5020-5030:5020-5030\" ${DEBUG_SETTINGS} ${EXPOSE_PORTS} -e RUN_SERVICES=none --env-file \"$DIR/../test/api/integration/.env.integration\""