chore(deploy): wire OIDC runtime configuration

This commit is contained in:
Piotr Oleszczyk 2026-03-12 15:55:32 +01:00
parent ffa3b71309
commit 4bfa4ea02d
7 changed files with 115 additions and 100 deletions

View file

@ -25,13 +25,27 @@ log() {
check_service() {
local service_name=$1
local url=$2
local allow_redirect=${3:-false}
if systemctl is-active --quiet "$service_name"; then
if curl -sf --max-time "$TIMEOUT" "$url" > /dev/null 2>&1; then
local curl_opts="-s --max-time $TIMEOUT"
if [ "$allow_redirect" = false ]; then
curl_opts="$curl_opts -f"
fi
if curl $curl_opts "$url" > /dev/null 2>&1; then
log "${GREEN}${NC} $service_name is healthy"
return 0
else
log "${YELLOW}${NC} $service_name is running but not responding at $url"
# If allow_redirect is true, we check if it's a 302
if [ "$allow_redirect" = true ]; then
local status=$(curl -s -o /dev/null -w "%{http_code}" --max-time "$TIMEOUT" "$url")
if [ "$status" = "302" ] || [ "$status" = "303" ] || [ "$status" = "307" ] || [ "$status" = "200" ]; then
log "${GREEN}${NC} $service_name is healthy (status $status)"
return 0
fi
fi
log "${YELLOW}${NC} $service_name is running but not responding correctly at $url"
return 1
fi
else
@ -45,8 +59,10 @@ backend_ok=0
frontend_ok=0
worker_ok=0
# Backend health-check is public and should return 200
check_service "innercontext" "$BACKEND_URL" || backend_ok=1
check_service "innercontext-node" "$FRONTEND_URL" || frontend_ok=1
# Frontend root may redirect to login (302)
check_service "innercontext-node" "$FRONTEND_URL" true || frontend_ok=1
# Worker doesn't have HTTP endpoint, just check if it's running
if systemctl is-active --quiet "innercontext-pricing-worker"; then