From fb927b7f713844426bb3293a1558e42856c6abf4 Mon Sep 17 00:00:00 2001 From: Aleksey Sabilin Date: Sun, 16 Aug 2026 00:25:12 +0300 Subject: [PATCH] fix(ci): e2e-stage defaults to *.stage.calentiq.com when secrets empty. Empty E2E_STAGE_* overrode :-defaults with blank hosts. Refs EventHub/EventHubBack#73 --- scripts/run-stand-api-tests.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/run-stand-api-tests.sh b/scripts/run-stand-api-tests.sh index 51aff91..17f58ef 100644 --- a/scripts/run-stand-api-tests.sh +++ b/scripts/run-stand-api-tests.sh @@ -12,17 +12,19 @@ set -euo pipefail STAND="${1:?stand: ift|stage}" case "${STAND}" in ift) - API_HOST="${API_HOST:-https://api.ift.eventhub.local}" - ADMIN_API_HOST="${ADMIN_API_HOST:-https://admin-api.ift.eventhub.local}" - WS_HOST="${WS_HOST:-wss://ws.ift.eventhub.local}" - ADMIN_WS_HOST="${ADMIN_WS_HOST:-wss://admin-ws.ift.eventhub.local}" + [[ -n "${API_HOST:-}" ]] || API_HOST="https://api.ift.eventhub.local" + [[ -n "${ADMIN_API_HOST:-}" ]] || ADMIN_API_HOST="https://admin-api.ift.eventhub.local" + [[ -n "${WS_HOST:-}" ]] || WS_HOST="wss://ws.ift.eventhub.local" + [[ -n "${ADMIN_WS_HOST:-}" ]] || ADMIN_WS_HOST="wss://admin-ws.ift.eventhub.local" DEVOPS_SMOKE="/opt/eventhub-ift/devops/scripts/smoke-core.sh" ;; stage) - API_HOST="${API_HOST:-https://api.stage.eventhub.local}" - ADMIN_API_HOST="${ADMIN_API_HOST:-https://admin-api.stage.eventhub.local}" - WS_HOST="${WS_HOST:-wss://ws.stage.eventhub.local}" - ADMIN_WS_HOST="${ADMIN_WS_HOST:-wss://admin-ws.stage.eventhub.local}" + # Публичный stage (канон STAGE-BROWSER.md). Пустые E2E_STAGE_* из CI + # не должны оставлять API_HOST="" (иначе CT бьёт в *.eventhub.local). + [[ -n "${API_HOST:-}" ]] || API_HOST="https://api.stage.calentiq.com" + [[ -n "${ADMIN_API_HOST:-}" ]] || ADMIN_API_HOST="https://admin-api.stage.calentiq.com" + [[ -n "${WS_HOST:-}" ]] || WS_HOST="wss://ws.stage.calentiq.com" + [[ -n "${ADMIN_WS_HOST:-}" ]] || ADMIN_WS_HOST="wss://admin-ws.stage.calentiq.com" DEVOPS_SMOKE="/opt/eventhub-stage/devops/scripts/smoke-core.sh" ;; *)