-
Notifications
You must be signed in to change notification settings - Fork 0
Deploy
John Shaughnessy edited this page Nov 1, 2023
·
2 revisions
This document outlines the deployment workflow of a server application involving a migration. The workflow consists of three main stages:
- Local Development
- Development Environment on GCP
- Production Environment on GCP
- Components: Docker container for PostgreSQL, Docker container for App Server
- Responsibilities: Active development, running migrations locally
- Debug Pointers: Inspect Docker logs, run manual tests on local machine
- Active Development: Write and modify code.
-
Docker Compose: Use
docker-compose up -d
to bring up Postgres and App containers. - Local Migrations: Run Diesel migrations against the local Postgres container.
- Testing: Execute local test suite.
- Infrastructure: Dedicated GCP VM
- Components: Docker Registry, PostgreSQL on VM, App Server on VM
- Responsibilities: Automated deployment and testing
- Debug Pointers: Check CI/CD pipeline logs, verify Docker registry uploads, examine VM logs
- Git Workflow: Push changes to a feature branch.
- CI/CD: Automatically build and upload Docker image to registry.
- Dev Migrations: Run Diesel migrations on Dev PostgreSQL.
- Dev Deployment: Deploy new image as a Docker container on the Dev VM.
- Automated Tests: Run any tests and report back.
- Infrastructure: Same as Development, but separated for isolation.
- Components: PostgreSQL, App Server
- Responsibilities: Final deployment, migration, and validation
- Debug Pointers: Check logs in the production environment, especially during and after migrations.
- App Shutdown: Stop the production App container but leave Postgres running.
- Prod Migrations: Execute Diesel migrations on production database through a temporary container.
- Prod Deployment: Bring up new App container from updated Docker image.
- Validation: Run production-specific tests to ensure everything is operational.
- For local debugging, consult Docker logs and local test outputs.
- In Dev and Prod, debugging involves checking pipeline logs, container statuses, and database logs.
- Migrations are executed against respective databases at the Dev and Prod stages.
- Testing is woven into each stage to ensure functional integrity.