ci(deploy): add migration control and deployment improvements
Test Suite / backend-pr-quick (push) Has been skipped
Test Suite / quick-import-pr-quick (push) Has been skipped
Test Suite / backend-full (push) Successful in 2m11s
Test Suite / flutter-quality (push) Failing after 1m20s

- Add SKIP_MIGRATION environment variable to control automatic Prisma migrations in backend
- Update Dockerfile to conditionally run migrations based on SKIP_MIGRATION flag
- Enhance deploy.sh with:
  - Better error handling using set -euo pipefail
  - New --skip-migration flag to bypass automatic migration startup
  - Improved documentation and help text
  - New helper functions for waiting on services and database
  - Better status reporting for migration results
- Update compose.yml to include SKIP_MIGRATION environment variable
This commit is contained in:
Nils-Johan Gynther
2026-05-21 14:13:54 +02:00
parent 67c3170067
commit 0ebb39150f
3 changed files with 155 additions and 74 deletions
+1 -1
View File
@@ -31,4 +31,4 @@ COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/dist ./dist
EXPOSE 8080
CMD ["sh", "-c", "until ./node_modules/.bin/prisma migrate deploy; do echo 'Migration failed, retrying in 5s...'; sleep 5; done && node dist/main"]
CMD ["sh", "-c", "if [ \"${SKIP_MIGRATION:-false}\" != \"true\" ]; then echo 'Running automatic Prisma migration...'; until ./node_modules/.bin/prisma migrate deploy --schema prisma/schema.prisma; do echo 'Migration failed, retrying in 5s...'; sleep 5; done; else echo 'Skipping automatic Prisma migration (SKIP_MIGRATION=true).'; fi && node dist/main"]