fix(ci): migrate postgres before jobs docker smoke test (#944)
Publish Docker Images / Smoke test (api) (push) Canceled after 0s
Publish Docker Images / Smoke test (dashboard) (push) Canceled after 0s
Publish Docker Images / Smoke test (jobs) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.api, api, api) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.dashboard, dashboard, dashboard) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.jobs, jobs, jobs) (push) Canceled after 0s

Jobs workers query analytics and media tables on boot. The smoke job
uses an empty database, so the worker never logs all-workers-running
and Publish Docker Images never pushes dashboard/api/jobs. Apply
drizzle migrations first, matching what the API entrypoint already does.
This commit is contained in:
Rotimi Best
2026-08-20 22:20:03 +01:00
committed by GitHub
parent 44f09bbe6b
commit 3f90249562
+9
View File
@@ -49,6 +49,15 @@ case "${SERVICE}" in
;; ;;
jobs) jobs)
# Workers query Postgres on boot (analytics rollups, media jobs, etc.).
# Apply schema first — this job has its own empty postgres, unlike api which
# runs db:setup in its entrypoint.
docker run --rm --network host \
-e DATABASE_URL="${DB_URL}" -e PRIVATE_DATABASE_URL="${DB_URL}" \
--entrypoint pnpm \
"${IMAGE}" \
--filter @cio/db db:migrate
docker run -d --name "${NAME}" --network host \ docker run -d --name "${NAME}" --network host \
-e NODE_ENV=production -e DATABASE_URL="${DB_URL}" -e REDIS_URL="${REDIS_URL}" \ -e NODE_ENV=production -e DATABASE_URL="${DB_URL}" -e REDIS_URL="${REDIS_URL}" \
"${IMAGE}" "${IMAGE}"