feat: prepare CMS pages for deployment
This commit is contained in:
@@ -8,7 +8,7 @@ For the command-level Chinese handoff guide, see `docs/local-db-to-production-de
|
||||
|
||||
- Git commit to deploy.
|
||||
- PostgreSQL database dump exported from the approved local database.
|
||||
- `media/` and `files/` directories exported from the same local workspace as the database dump.
|
||||
- `media/`, `files/`, and `videos/` directories exported from the same local workspace as the database dump.
|
||||
- Production environment variables from `.env.example`, filled with production values.
|
||||
|
||||
## Required Environment
|
||||
@@ -36,9 +36,9 @@ Optional variables:
|
||||
3. Export the approved PostgreSQL database:
|
||||
`pg_dump --format=custom --no-owner --no-acl --file=eversolo.payload.dump "$DATABASE_URI"`.
|
||||
4. Export matching uploads:
|
||||
`tar -czf eversolo.uploads.tgz media files`.
|
||||
`tar -czf eversolo.uploads.tgz media files videos`.
|
||||
5. Restore the approved PostgreSQL dump into the production database with `pg_restore --no-owner --no-acl`.
|
||||
6. Copy `media/` and `files/` to the production persistent upload volume.
|
||||
6. Copy `media/`, `files/`, and `videos/` to the production persistent upload volume.
|
||||
7. Install dependencies with `npm ci`.
|
||||
8. Run `npm run generate:types` only during build validation, not as a production data mutation step.
|
||||
9. Run `npm run typecheck`.
|
||||
@@ -56,7 +56,7 @@ Optional variables:
|
||||
- Before exporting a local database for production, confirm `payload_migrations` has no `batch = -1` dev marker. That marker means schema push history is still recorded and production migration commands can prompt interactively.
|
||||
- Do not edit migrations after they have shipped to production. Add a new forward migration instead.
|
||||
- Keep schema migrations and data backfills separate. Backfill scripts in `src/scripts/` are manual operational tools, not automatic boot steps.
|
||||
- The deployed database and upload directories must come from the same local export, otherwise media relationships can point at missing files.
|
||||
- The deployed database and upload directories must come from the same local export, otherwise media/video/file relationships can point at missing files.
|
||||
- Admin login captcha is stateless and signed with `PAYLOAD_SECRET`; changing that secret invalidates existing login sessions and outstanding captcha tokens.
|
||||
|
||||
## Rollback
|
||||
@@ -65,7 +65,7 @@ Rollback means switching code and data together:
|
||||
|
||||
1. Stop traffic or move traffic back to the previous deployment.
|
||||
2. Restore the previous database dump.
|
||||
3. Restore the matching previous `media/` and `files/` directories.
|
||||
3. Restore the matching previous `media/`, `files/`, and `videos/` directories.
|
||||
4. Deploy the previous Git commit.
|
||||
5. Re-run smoke checks before reopening traffic.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user