@@ -14,6 +14,7 @@ source "${SCRIPT_DIR}/lib.sh"
14
14
set -euo pipefail
15
15
16
16
CODER_DEV_ACCESS_URL=" ${CODER_DEV_ACCESS_URL:- http:// 127.0.0.1: 3000} "
17
+ DEVELOP_IN_CODER=" ${DEVELOP_IN_CODER:- 0} "
17
18
debug=0
18
19
DEFAULT_PASSWORD=" SomeSecurePassword!"
19
20
password=" ${CODER_DEV_ADMIN_PASSWORD:- ${DEFAULT_PASSWORD} } "
@@ -66,6 +67,10 @@ if [ "${CODER_BUILD_AGPL:-0}" -gt "0" ] && [ "${multi_org}" -gt "0" ]; then
66
67
echo ' == ERROR: cannot use both multi-organizations and APGL build.' && exit 1
67
68
fi
68
69
70
+ if [ -n " ${CODER_AGENT_URL} " ]; then
71
+ DEVELOP_IN_CODER=1
72
+ fi
73
+
69
74
# Preflight checks: ensure we have our required dependencies, and make sure nothing is listening on port 3000 or 8080
70
75
dependencies curl git go make pnpm
71
76
curl --fail http://127.0.0.1:3000 > /dev/null 2>&1 && echo ' == ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1
@@ -75,7 +80,7 @@ curl --fail http://127.0.0.1:8080 >/dev/null 2>&1 && echo '== ERROR: something i
75
80
# node_modules if necessary.
76
81
GOOS=" $( go env GOOS) "
77
82
GOARCH=" $( go env GOARCH) "
78
- make -j " build/coder_${GOOS} _${GOARCH} "
83
+ DEVELOP_IN_CODER= " ${DEVELOP_IN_CODER} " make -j " build/coder_${GOOS} _${GOARCH} "
79
84
80
85
# Use the coder dev shim so we don't overwrite the user's existing Coder config.
81
86
CODER_DEV_SHIM=" ${PROJECT_ROOT} /scripts/coder-dev.sh"
@@ -150,7 +155,7 @@ fatal() {
150
155
trap ' fatal "Script encountered an error"' ERR
151
156
152
157
cdroot
153
- DEBUG_DELVE=" ${debug} " start_cmd API " " " ${CODER_DEV_SHIM} " server --http-address 0.0.0.0:3000 --swagger-enable --access-url " ${CODER_DEV_ACCESS_URL} " --dangerous-allow-cors-requests=true --enable-terraform-debug-mode " $@ "
158
+ DEBUG_DELVE=" ${debug} " DEVELOP_IN_CODER= " ${DEVELOP_IN_CODER} " start_cmd API " " " ${CODER_DEV_SHIM} " server --http-address 0.0.0.0:3000 --swagger-enable --access-url " ${CODER_DEV_ACCESS_URL} " --dangerous-allow-cors-requests=true --enable-terraform-debug-mode " $@ "
154
159
155
160
echo ' == Waiting for Coder to become ready'
156
161
# Start the timeout in the background so interrupting this script
0 commit comments