chore: override codersdk.SessionTokenCookie in develop.sh (#18991)

Updates `develop.sh`, `coder-dev.sh` and `build_go.sh` to conditionally override `codersdk.SessionTokenCookie` for usage in nested development scenario.
This commit is contained in:
Cian Johnston
2025-07-23 12:48:15 +01:00
committed by GitHub
parent f41275eb39
commit bb83071b5f
7 changed files with 35 additions and 10 deletions
+8 -2
View File
@@ -10,6 +10,8 @@ source "${SCRIPT_DIR}/lib.sh"
GOOS="$(go env GOOS)"
GOARCH="$(go env GOARCH)"
CODER_AGENT_URL="${CODER_AGENT_URL:-}"
DEVELOP_IN_CODER="${DEVELOP_IN_CODER:-0}"
DEBUG_DELVE="${DEBUG_DELVE:-0}"
BINARY_TYPE=coder-slim
if [[ ${1:-} == server ]]; then
@@ -35,6 +37,10 @@ CODER_DEV_DIR="$(realpath ./.coderv2)"
CODER_DELVE_DEBUG_BIN=$(realpath "./build/coder_debug_${GOOS}_${GOARCH}")
popd
if [ -n "${CODER_AGENT_URL}" ]; then
DEVELOP_IN_CODER=1
fi
case $BINARY_TYPE in
coder-slim)
# Ensure the coder slim binary is always up-to-date with local
@@ -42,9 +48,9 @@ coder-slim)
# NOTE: we send all output of `make` to /dev/null so that we do not break
# scripts that read the output of this command.
if [[ -t 1 ]]; then
make -j "${RELATIVE_BINARY_PATH}"
DEVELOP_IN_CODER="${DEVELOP_IN_CODER}" make -j "${RELATIVE_BINARY_PATH}"
else
make -j "${RELATIVE_BINARY_PATH}" >/dev/null 2>&1
DEVELOP_IN_CODER="${DEVELOP_IN_CODER}" make -j "${RELATIVE_BINARY_PATH}" >/dev/null 2>&1
fi
;;
coder)