alembic fix

This commit is contained in:
2026-06-01 16:34:07 +03:00
parent e12a9ddfce
commit 4c5da7e4d9
15 changed files with 346 additions and 90 deletions

View File

@@ -234,19 +234,16 @@ stage1_enterprise_clean() {
docker build -f docker/frontend.Dockerfile -t "ss-tools-frontend:${RELEASE_TAG}" .
fi
# ── 1.3. START POSTGRESQL ────────────────────────────────
# ── 1.3. START POSTGRESQL (on default bridge first) ─────
log_info "Step 1.3: Starting new PostgreSQL container..."
docker rm -f ss-tools-e2e-pg 2>/dev/null || true
# Create the network that docker compose will use (ss-tools-e2e-ec_default)
# so PostgreSQL is on the same network and resolvable by container name.
if ! docker network inspect ss-tools-e2e-ec_default >/dev/null 2>&1; then
docker network create ss-tools-e2e-ec_default
fi
# Remove any stale compose network so docker compose creates it fresh
docker network rm ss-tools-e2e-ec_default 2>/dev/null || true
# Start PG on default bridge initially — compose will create its own network
docker run -d \
--name ss-tools-e2e-pg \
--network ss-tools-e2e-ec_default \
-e POSTGRES_DB=ss_tools \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
@@ -267,7 +264,6 @@ stage1_enterprise_clean() {
sleep 1
done
# Get PostgreSQL container IP on the enterprise network
EC_PG_HOST="ss-tools-e2e-pg"
EC_PG_PORT="5432"
@@ -308,11 +304,20 @@ EOF
export FRONTEND_TAG="${RELEASE_TAG}"
fi
# Start compose FIRST so it creates the network with proper compose labels.
# The backend will fail to connect to PG on first start (PG not on compose network
# yet), but Docker restart policy (unless-stopped) will retry.
docker compose -p ss-tools-e2e-ec \
-f "$EC_COMPOSE_FILE" \
--env-file "/tmp/.env.e2e-enterprise-clean" \
up -d
# Connect PG to the compose-created network so backend can resolve ss-tools-e2e-pg
docker network connect ss-tools-e2e-ec_default ss-tools-e2e-pg
# Restart backend so entrypoint reruns with PG accessible
docker compose -p ss-tools-e2e-ec restart backend
# ── 1.5. WAIT FOR BACKEND + FRONTEND ────────────────────
log_info "Step 1.5: Waiting for services..."