From e9d1db1fc9a248aebf7f944f6687360cb8a77e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Wed, 22 Jul 2026 22:48:57 +0200 Subject: [PATCH] ci(forgejo): create PostGIS extension before db:push + wipe stale DinD state - Ensure PostGIS: the postgis image doesn't auto-create the extension in POSTGRES_DB, so drizzle-kit push's geometry columns died silently (behind its spinner). Create it explicitly before db:push in e2e + image-smoke. - e2e: wipe leftover containers/volumes on the persistent per-slot DinD at job start (stale pgdata left postgres unhealthy). Co-Authored-By: Claude Opus 4.8 (1M context) --- .forgejo/workflows/ci.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 7002b67..8a8c1b6 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -209,6 +209,14 @@ jobs: cache: pnpm - run: pnpm install --frozen-lockfile + - name: Clean this runner's DinD (fresh state per job) + # The per-slot DinD persists across jobs, so wipe leftover containers + + # volumes from a previous run (a stale pgdata leaves postgres unhealthy). + # Safe: this DinD only ever runs CI containers for this one runner. + run: | + docker rm -f $(docker ps -aq) 2>/dev/null || true + docker volume rm -f trails_brouter_segments trails_pgdata 2>/dev/null || true + - name: Seed BRouter segment volume # Download the segment directly into the compose volume via a DinD # container — a job-side download + bind mount would not be visible to @@ -241,9 +249,13 @@ jobs: sleep 2 done + - name: Ensure PostGIS extension + # The postgis image does NOT auto-create the extension in POSTGRES_DB, + # so drizzle-kit push's geometry columns fail (silently, behind its + # spinner). Create it first (trails is superuser in the image). + run: node -e "const{Client}=require('pg');const c=new Client(process.env.DATABASE_URL);c.connect().then(()=>c.query('CREATE EXTENSION IF NOT EXISTS postgis')).then(()=>console.log('postgis ready')).catch(e=>{console.error(e.message);process.exit(1)}).finally(()=>c.end())" + - name: Push database schema - # Pipe through cat so drizzle-kit prints plain output (no TTY spinner - # that hides the real error) and we see any failure. run: pnpm db:push 2>&1 | cat - name: Seed database @@ -351,9 +363,13 @@ jobs: cache: pnpm - run: pnpm install --frozen-lockfile + - name: Ensure PostGIS extension + # The postgis image does NOT auto-create the extension in POSTGRES_DB, + # so drizzle-kit push's geometry columns fail (silently, behind its + # spinner). Create it first (trails is superuser in the image). + run: node -e "const{Client}=require('pg');const c=new Client(process.env.DATABASE_URL);c.connect().then(()=>c.query('CREATE EXTENSION IF NOT EXISTS postgis')).then(()=>console.log('postgis ready')).catch(e=>{console.error(e.message);process.exit(1)}).finally(()=>c.end())" + - name: Push database schema - # Pipe through cat so drizzle-kit prints plain output (no TTY spinner - # that hides the real error) and we see any failure. run: pnpm db:push 2>&1 | cat - name: Build journal runtime image