mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user