Template
CI reads Infisical staging as the read-only convexmonorepo-base-ci machine identity, runs the quality gate, and builds and pushes the image. The template is not deployed, so there is no Convex or VPS deploy step. The local stack moves to its own Compose name and ports so it runs beside the Payload template's, and it syncs the Convex runtime env. The scripts pick up Infisical account switching, dev-kill and a cache-safe CI install.
43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [ -n "${CI:-}" ]; then echo "CI detected; skipping local e2e."; exit 0; fi
|
|
if [ -n "${SKIP_E2E:-}" ]; then echo "SKIP_E2E set; skipping local e2e."; exit 0; fi
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
ROOT_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
if command -v docker >/dev/null 2>&1; then RUNTIME=docker
|
|
elif command -v podman >/dev/null 2>&1; then RUNTIME=podman
|
|
else echo "Docker or Podman is required for local e2e." >&2; exit 1; fi
|
|
|
|
container_running() {
|
|
"$RUNTIME" ps --format '{{.Names}}' | grep -qx "$1"
|
|
}
|
|
|
|
if container_running convexmonorepo-base-local-convex \
|
|
&& container_running convexmonorepo-base-local-convex-dashboard; then
|
|
SHOULD_STOP_STACK=false
|
|
else
|
|
SHOULD_STOP_STACK=true
|
|
fi
|
|
|
|
cleanup() {
|
|
if [ "$SHOULD_STOP_STACK" = true ]; then
|
|
"$RUNTIME" rm -f \
|
|
convexmonorepo-base-local-convex-dashboard \
|
|
convexmonorepo-base-local-convex \
|
|
>/dev/null 2>&1 || true
|
|
fi
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
if [ "$SHOULD_STOP_STACK" = true ]; then
|
|
bash "$ROOT_DIR/scripts/db/up"
|
|
fi
|
|
|
|
curl -fs "http://localhost:${BACKEND_PORT:-3210}/version" >/dev/null
|
|
curl -fs "http://localhost:${DASHBOARD_PORT:-6791}" >/dev/null
|
|
|
|
echo "Local-stack smoke checks passed; no seeded browser flow is configured."
|