Skip to content

Commit 7f366a4

Browse files
committed
disable port assignment for multi-site bindings
1 parent b231ec2 commit 7f366a4

1 file changed

Lines changed: 28 additions & 13 deletions

File tree

build/util/start-server.sh

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,34 @@ if [[ $DRY_RUN_FLAG == "false" ]]; then
1717
. $BUILD_DIR/util/adobe-cfpm.sh
1818
fi
1919

20-
21-
logMessage "INFO" "$( box server start \
22-
trayEnable=false \
23-
host=0.0.0.0 \
24-
openbrowser=false \
25-
port=${PORT} \
26-
sslPort=${SSL_PORT} \
27-
saveSettings=false \
28-
dryRun=${DRY_RUN_FLAG} \
29-
console=${DRY_RUN_FLAG} \
30-
startScript=${SCRIPT_TYPE} \
31-
startScriptFile=${APP_DIR}/server-start.sh \
32-
verbose=true )"
20+
# Check if server.json has any listen bindings defined - if so we skip port settings
21+
DEFINED_SERVERCONFIGFILE=${BOX_SERVER_SERVERCONFIGFILE:=server.json}
22+
if [[ -f "${DEFINED_SERVERCONFIGFILE}" ]] && [[ "$(jq 'any(.sites[]?; .bindings[]?.listen)' "${DEFINED_SERVERCONFIGFILE}")" == "true" ]]; then
23+
logMessage "INFO" "Detected custom multi-site listen bindings in ${DEFINED_SERVERCONFIGFILE}, skipping port and sslPort settings"
24+
logMessage "INFO" "$( box server start \
25+
trayEnable=false \
26+
host=0.0.0.0 \
27+
openbrowser=false \
28+
saveSettings=false \
29+
dryRun=${DRY_RUN_FLAG} \
30+
console=${DRY_RUN_FLAG} \
31+
startScript=${SCRIPT_TYPE} \
32+
startScriptFile=${APP_DIR}/server-start.sh \
33+
verbose=true )"
34+
else
35+
logMessage "INFO" "$( box server start \
36+
trayEnable=false \
37+
host=0.0.0.0 \
38+
openbrowser=false \
39+
port=${PORT} \
40+
sslPort=${SSL_PORT} \
41+
saveSettings=false \
42+
dryRun=${DRY_RUN_FLAG} \
43+
console=${DRY_RUN_FLAG} \
44+
startScript=${SCRIPT_TYPE} \
45+
startScriptFile=${APP_DIR}/server-start.sh \
46+
verbose=true )"
47+
fi
3348

3449
# Adobe 2021 package manager installs after the server files are in place
3550
if [[ $DRY_RUN_FLAG == "true" ]]; then

0 commit comments

Comments
 (0)