ci(deploy): add migration control and deployment improvements
- 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:
+1
-1
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user