All checks were successful
Sync infra to hosts / sync-beta (push) Has been skipped
Sync infra to hosts / sync-prod (push) Has been skipped
Sync infra to hosts / sync-centralis (push) Has been skipped
Sync infra to hosts / sync-dev (push) Successful in 9s
secrets-guard / encrypted (push) Successful in 5s
Validate observability stack / validate (push) Successful in 12s
shell-lint / shellcheck (push) Successful in 8s
Build + push images (Forgejo registry) / build-push (frontend) (push) Successful in 26s
Build + push images (Forgejo registry) / build-push (backend) (push) Successful in 1m10s
Deploy / deploy (backend) (push) Successful in 1m41s
Deploy / deploy (frontend) (push) Successful in 1m48s
secrets-guard / encrypted (pull_request) Successful in 8s
shell-lint / shellcheck (pull_request) Successful in 9s
PR build (required check) / changes (pull_request) Successful in 20s
PR build (required check) / validate-observability (pull_request) Successful in 15s
PR build (required check) / build-frontend (pull_request) Successful in 17s
PR build (required check) / build-backend (pull_request) Successful in 2m26s
PR build (required check) / gate (pull_request) Successful in 1s
Completes the Forgejo domain migration. ROOT_URL moved to dev.jinemi.com earlier; the registry half was deliberately deferred. Every image name, REGISTRY_HOST default, runner label and --add-host pin now names dev.jinemi.com, so the registry host and the bearer-token realm agree again. Both names address the same Forgejo, so no image needs re-pushing and a rollback to a tag pushed under the old prefix still resolves. git.thermograph.org therefore stays served off the same Caddy site block -- one block, so the /v2/* mesh-only matcher keeps covering both names -- for pre-migration tags and for runners holding it as their registered instance URL. Mesh clients now pin both names in /etc/hosts: the new one as registry host and token realm, the old one for pre-migration tags. runner-vps2/config.yaml carries both --add-host entries for the same reason. Also renames Centralis' endpoint to mcp.jinemi.com in the two places this repo names it; Centralis itself is provisioned outside this repo. Host-side steps this cannot do (documented in deploy/forgejo/README.md, "Host-side steps"): the Forgejo Actions variable REGISTRY_HOST, docker login against the new host, and the /etc/hosts pins.
45 lines
2 KiB
Bash
Executable file
45 lines
2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Image boot-smoke: prove the backend IMAGE actually boots and serves its contract
|
|
# (a `docker build` succeeding does not prove the container starts). Builds the image
|
|
# locally (or uses a provided BACKEND_IMAGE_TAG), runs it + a throwaway TimescaleDB via
|
|
# docker-compose.test.yml, waits for /healthz, then asserts /healthz and the version
|
|
# endpoint. Always tears the stack down.
|
|
#
|
|
# ./scripts/smoke.sh # build :local and smoke it
|
|
# BACKEND_IMAGE_TAG=sha-abc123 ./scripts/smoke.sh # smoke a published image (CI)
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-smoke}"
|
|
# The image to smoke, pulled from the registry (no local build). CI passes the just-
|
|
# pushed sha (BACKEND_IMAGE_TAG=sha-<12hex>); locally it defaults to a published tag.
|
|
export BACKEND_IMAGE_TAG="${BACKEND_IMAGE_TAG:-v0.0.2-split-ci}"
|
|
IMG="${REGISTRY_HOST:-dev.jinemi.com}/${BACKEND_IMAGE_PATH:-admin_emi/thermograph-backend/app}:${BACKEND_IMAGE_TAG}"
|
|
export SMOKE_HOST_PORT="${SMOKE_HOST_PORT:-18137}"
|
|
COMPOSE=(docker compose -f docker-compose.test.yml)
|
|
PORT_URL="http://127.0.0.1:${SMOKE_HOST_PORT}"
|
|
|
|
cleanup() { echo "==> tearing down"; "${COMPOSE[@]}" down -v --remove-orphans >/dev/null 2>&1 || true; }
|
|
trap cleanup EXIT
|
|
|
|
echo "==> pulling $IMG"
|
|
"${COMPOSE[@]}" pull backend
|
|
|
|
echo "==> starting backend + db ($IMG)"
|
|
"${COMPOSE[@]}" up -d
|
|
|
|
echo "==> waiting for /healthz (up to 90s)"
|
|
for _ in $(seq 1 45); do
|
|
if curl -fsS -o /dev/null "$PORT_URL/healthz"; then ok=1; break; fi
|
|
sleep 2
|
|
done
|
|
[ "${ok:-}" = 1 ] || { echo "!! backend never became healthy"; "${COMPOSE[@]}" logs --tail=40 backend; exit 1; }
|
|
|
|
echo "==> asserting contract"
|
|
curl -fsS "$PORT_URL/healthz" >/dev/null && echo " /healthz 200 ok"
|
|
ver=$(curl -fsS "$PORT_URL/api/version")
|
|
echo " /api/version -> $ver"
|
|
echo "$ver" | grep -q '"backend_version"[[:space:]]*:[[:space:]]*"2"' \
|
|
|| { echo "!! /api/version did not report backend_version=2"; exit 1; }
|
|
|
|
echo "==> SMOKE PASSED"
|