-
Notifications
You must be signed in to change notification settings - Fork 31
IAC Setup #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit adds Google Cloud Platform as a deployment target for the Shareabouts API. Infrastructure: - Added OpenTofu configuration for GCP in `infra/gcp/`. Can add other platform tofu configs in infra/ later. - Configured Cloud Run for the API service. - Set up Cloud SQL (PostgreSQL) and Cloud Memorystore (Redis). - Created GCS bucket for media attachments. Application: - Updated `settings.py` for GCP-compatible storage, database, and cache. - Reverted static file serving to use local container serving (via `dj_static`) to preserve custom middleware functionality. - Updated `Containerfile` with collection of static files. - Integrated `google-cloud-logging` for GCP Error Reporting. Documentation: - Added comprehensive GCP deployment instructions in `doc/DEPLOY.md`.
…ose services, and add a test error endpoint.
…oyments and simplify Docker Compose configuration.
…mand from Containerfile for web service
…ting, update deployment documentation, and refine Celery broker URL parsing.
…make it a prerequisite for tests.
….x and match the local development environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR sets up Infrastructure as Code (IAC) for deploying the Shareabouts API to Google Cloud Platform using OpenTofu/Terraform. It also migrates CI/CD from Travis CI to GitHub Actions and adds a Makefile for common deployment tasks.
Changes:
- Added comprehensive Terraform/OpenTofu infrastructure configuration for GCP (Cloud Run, Cloud SQL, Redis, GCS, networking, IAM, secrets)
- Migrated from Travis CI to GitHub Actions for testing
- Added Makefile with targets for building, testing, and deploying to GCP
- Updated Containerfile to use virtual environment and support Cloud Run deployment
- Enhanced settings.py with GCP-specific configuration (GCS storage, database from components)
- Updated compose.yml to support test service and better environment configuration
Reviewed changes
Copilot reviewed 21 out of 24 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/gcp/*.tf | Terraform/OpenTofu infrastructure definitions for GCP resources including Cloud Run, Cloud SQL, Redis, networking, storage, IAM, and secrets management |
| .github/workflows/test.yml | New GitHub Actions workflow replacing Travis CI for automated testing |
| Makefile | Build and deployment automation for local development and GCP deployment |
| Containerfile | Enhanced container definition with virtual environment and Cloud Run compatibility |
| src/project/settings.py | Added GCS storage backend and database configuration from environment components |
| src/project/urls.py | Added test error endpoint for debugging |
| compose.yml | Updated with test service and improved environment variable configuration |
| doc/DEPLOY.md | Added comprehensive GCP deployment documentation |
| requirements.txt | Added google-cloud-storage dependency |
| gunicorn.conf.py | Added logging and timeout configuration |
Files not reviewed (1)
- infra/gcp/.terraform.lock.hcl: Language not supported
Comments suppressed due to low confidence (1)
src/project/settings.py:100
- This assignment to 'ATTACHMENT_STORAGE' is unnecessary as it is redefined before this value is used.
ATTACHMENT_STORAGE = 'django.core.files.storage.FileSystemStorage'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…REFIX` configuration via environment variables for Cloud Run deployment.
…OSTS` environment variable to automatically include Cloud Run and custom domain URLs.
…v2 domain management, load balancing, and SSL certificates.
…ne to Certificate Manager.
…n and service configurations These secrets archive the tfvars setup needed to work with the infrastructure.
Uh oh!
There was an error while loading. Please reload this page.