Update hivegrid-cloud reference to latest main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
davidandClaude Fable 5 committed 2026-07-08 16:15:37 +02:00
1 parent e98d38e716
commit 7b21524c86
3781 files changed
+373484 -225607

No files matched your search

@@ -1,17 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail
IMAGE="${1:-toolctrl-web:smoke}"
IMAGE="${1:-hivegrid-web:smoke}"
PORT="${DOCKER_WEB_SMOKE_PORT:-}"
CONTAINER_NAME="${DOCKER_WEB_SMOKE_CONTAINER:-toolctrl-web-runtime-smoke-$$}"
DB_CONTAINER_NAME="${DOCKER_WEB_SMOKE_DB_CONTAINER:-toolctrl-web-runtime-smoke-db-$$}"
NETWORK_NAME="${DOCKER_WEB_SMOKE_NETWORK:-toolctrl-web-runtime-smoke-$$}"
CONTAINER_NAME="${DOCKER_WEB_SMOKE_CONTAINER:-hivegrid-web-runtime-smoke-$$}"
DB_CONTAINER_NAME="${DOCKER_WEB_SMOKE_DB_CONTAINER:-hivegrid-web-runtime-smoke-db-$$}"
NETWORK_NAME="${DOCKER_WEB_SMOKE_NETWORK:-hivegrid-web-runtime-smoke-$$}"
TRANSPORT="${DOCKER_WEB_SMOKE_TRANSPORT:-host}"
SMOKE_REVISION="${DOCKER_WEB_SMOKE_REVISION:-}"
HEALTH_ATTEMPTS="${DOCKER_WEB_SMOKE_HEALTH_ATTEMPTS:-300}"
DB_PASSWORD="toolctrl"
DB_NAME="toolctrl"
DB_USER="toolctrl"
# The boot path runs migrate + seed before the server listens, so the health
# window has to cover the full migration chain against an empty database.
HEALTH_ATTEMPTS="${DOCKER_WEB_SMOKE_HEALTH_ATTEMPTS:-600}"
DB_PASSWORD="hivegrid"
DB_NAME="hivegrid"
DB_USER="hivegrid"
cleanup() {
docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
@@ -97,7 +99,7 @@ expect_openapi_json() {
const fs = require("node:fs");
const payload = JSON.parse(fs.readFileSync(0, "utf8"));
if (typeof payload.openapi !== "string") throw new Error("missing openapi version");
if (!payload.paths || !payload.paths["/v1/health"] || !payload.paths["/v1/entities/{entity}/rows"]) {
if (!payload.paths || !payload.paths["/v1/health"] || !payload.paths["/v1/session/current-user"]) {
throw new Error("missing expected OpenAPI paths");
}
'
@@ -135,34 +137,18 @@ for attempt in $(seq 1 30); do
sleep 1
done
docker run --rm --network "$NETWORK_NAME" \
-e NODE_ENV=production \
-e APP_NAME=ToolCTRL \
-e APP_BASE_DOMAIN=localhost \
-e WEB_APP_HOST=app.localhost \
-e ADMIN_APP_HOST=admin.localhost \
-e API_HOST=api.localhost \
-e APP_PROTOCOL=http \
-e DATABASE_URL="$CONTAINER_DATABASE_URL" \
-e SESSION_SECRET='deploy-smoke-session-secret-minimum-32' \
-e CRYPTO_SECRET='deploy-smoke-crypto-secret-minimum-32' \
-e JWT_SECRET='deploy-smoke-jwt-secret-minimum-32' \
-e API_ACCESS_TOKEN='deploy-smoke-api-access-token-minimum-32' \
-e ANALYTICS_TOKEN='deploy-smoke-analytics-token-minimum-32' \
-e SEED_ADMIN_EMAIL='deploy-smoke-admin@example.test' \
-e SEED_ADMIN_PASSWORD='deploy-smoke-password-minimum-32' \
--entrypoint /bin/sh \
"$IMAGE" -lc 'cd /myapp && pnpm exec prisma migrate deploy --config prisma.config.ts && NODE_ENV=production node packages/db/dist/production-seed.server.js' >/dev/null
publish_args=(-p 127.0.0.1::8080)
if [[ -n "$PORT" ]]; then
publish_args=(-p "${PORT}:8080")
fi
# Migrations and the guarded seed run through the entrypoint boot path
# (MIGRATE_ON_BOOT/SEED_ON_BOOT), exactly like the Coolify staging/production
# web resources — this smoke is the PR-level rehearsal of that boot contract.
docker run -d --name "$CONTAINER_NAME" --network "$NETWORK_NAME" "${publish_args[@]}" \
-e NODE_ENV=production \
-e PORT=8080 \
-e APP_NAME=ToolCTRL \
-e APP_NAME=HiveGrid \
-e APP_BASE_DOMAIN=localhost \
-e WEB_APP_HOST=app.localhost \
-e ADMIN_APP_HOST=admin.localhost \
@@ -174,6 +160,12 @@ docker run -d --name "$CONTAINER_NAME" --network "$NETWORK_NAME" "${publish_args
-e JWT_SECRET='deploy-smoke-jwt-secret-minimum-32' \
-e API_ACCESS_TOKEN='deploy-smoke-api-access-token-minimum-32' \
-e ANALYTICS_TOKEN='deploy-smoke-analytics-token-minimum-32' \
-e MCP_RESOURCE_URL='http://mcp.localhost:8080' \
-e MCP_AUTHORIZATION_SERVER_URL='http://app.localhost' \
-e SEED_ADMIN_EMAIL='deploy-smoke-admin@example.test' \
-e SEED_ADMIN_PASSWORD='deploy-smoke-password-minimum-32' \
-e MIGRATE_ON_BOOT=true \
-e SEED_ON_BOOT=true \
"$IMAGE" >/dev/null
if [[ -z "$PORT" ]]; then
@@ -185,6 +177,12 @@ for attempt in $(seq 1 "$HEALTH_ATTEMPTS"); do
break
fi
if [[ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME" 2>/dev/null)" != "true" ]]; then
echo "Web container exited during boot — MIGRATE_ON_BOOT/SEED_ON_BOOT failure aborts the start by design" >&2
docker logs "$CONTAINER_NAME" >&2 || true
exit 1
fi
if [[ "$attempt" == "$HEALTH_ATTEMPTS" ]]; then
echo "Web container did not become healthy on port ${PORT} after ${HEALTH_ATTEMPTS}s" >&2
docker logs "$CONTAINER_NAME" >&2 || true
@@ -194,6 +192,20 @@ for attempt in $(seq 1 "$HEALTH_ATTEMPTS"); do
sleep 1
done
# Prove the entrypoint boot contract actually ran (not a container that came
# up against a pre-migrated database through some other path).
BOOT_LOGS="$(docker logs "$CONTAINER_NAME" 2>&1)"
if ! grep -q '^\[boot\] prisma migrate deploy' <<<"$BOOT_LOGS"; then
echo "Web container logs are missing the MIGRATE_ON_BOOT migration banner" >&2
docker logs "$CONTAINER_NAME" >&2 || true
exit 1
fi
if ! grep -q '^\[boot\] production seed' <<<"$BOOT_LOGS"; then
echo "Web container logs are missing the SEED_ON_BOOT seed banner" >&2
docker logs "$CONTAINER_NAME" >&2 || true
exit 1
fi
expect_status app.localhost /healthz 200
expect_health_revision app.localhost /healthz
expect_status app.localhost /readyz 200