Files
pikasTech-HWLAB/deploy/runtime/boot/hwlab-codex-api-responses-forwarder.sh
T
2026-07-21 17:18:47 +02:00

31 lines
1.2 KiB
Bash

#!/bin/sh
set -eu
export HWLAB_SERVICE_ID="hwlab-codex-api-responses-forwarder"
export HWLAB_ARTIFACT_KIND="bun-command"
export HWLAB_SERVICE_ENTRYPOINT="cmd/hwlab-codex-api-responses-forwarder/main.ts"
export HWLAB_RUNTIME_MODE="${HWLAB_RUNTIME_MODE:-env-reuse-gitea-checkout}"
export HWLAB_COMMIT_ID="${HWLAB_BOOT_COMMIT:?HWLAB_BOOT_COMMIT is required}"
export HWLAB_REVISION="${HWLAB_BOOT_COMMIT}"
export HWLAB_IMAGE="${HWLAB_ENVIRONMENT_IMAGE:-${HWLAB_IMAGE:-}}"
export HWLAB_IMAGE_DIGEST="${HWLAB_ENVIRONMENT_DIGEST:-${HWLAB_IMAGE_DIGEST:-unknown}}"
export PORT="${PORT:-${HWLAB_CODE_AGENT_CODEX_API_FORWARDER_PORT:-49280}}"
export HWLAB_PORT="$PORT"
export HWLAB_CODE_AGENT_CODEX_API_FORWARDER_PORT="$PORT"
bun_bin="${HWLAB_BUN_COMMAND:-}"
if [ -z "$bun_bin" ]; then
if command -v bun >/dev/null 2>&1; then
bun_bin="$(command -v bun)"
elif [ -x /usr/local/bin/bun ]; then
bun_bin="/usr/local/bin/bun"
elif [ -x ./node_modules/.bin/bun ]; then
bun_bin="./node_modules/.bin/bun"
else
echo "hwlab-codex-api-responses-forwarder boot failed: bun not found" >&2
exit 127
fi
fi
exec "$bun_bin" run cmd/hwlab-codex-api-responses-forwarder/main.ts