From 3321d4575a2c20a45cbb2fa3bd9983be504d8207 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Mon, 30 Mar 2026 20:41:46 -0500 Subject: [PATCH] fix(ci): wait for postgres readiness before migration + tests --- .woodpecker/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml index 1cc092b..e39e5da 100644 --- a/.woodpecker/ci.yml +++ b/.woodpecker/ci.yml @@ -48,7 +48,18 @@ steps: DATABASE_URL: postgresql://mosaic:mosaic@postgres:5432/mosaic commands: - *enable_pnpm - - pnpm --filter @mosaic/db run db:migrate 2>/dev/null || true + # Install postgresql-client for pg_isready + - apk add --no-cache postgresql-client + # Wait up to 30s for postgres to be ready + - | + for i in $(seq 1 30); do + pg_isready -h postgres -p 5432 -U mosaic && break + echo "Waiting for postgres ($i/30)..." + sleep 1 + done + # Run migrations (DATABASE_URL is set in environment above) + - pnpm --filter @mosaic/db run db:migrate + # Run all tests - pnpm test depends_on: - typecheck