Operations
Environment Variables
| Variable | Default | Description |
|---|---|---|
|
|
HTTP server listen port |
|
|
Log verbosity ( |
|
— |
PostgreSQL connection string (e.g. |
|
|
Set to |
|
— |
Escher credential scope |
|
— |
Escher key database (JSON) |
|
— |
Cloud SQL database name (used with Cloud SQL Auth Proxy) |
|
— |
Cloud SQL database user |
|
— |
Cloud SQL instance connection name |
When DATABASE_URL is set it takes precedence over the PG_* Cloud SQL variables.
Deployment
The service is deployed via GAP. The deployment pipeline:
-
Builds the Docker image
-
Runs
cmd/migrateas a pre-deploy job to apply any pending database migrations -
Deploys the
cmd/apiHTTP server -
Keeps
cmd/maintenancerunning as a cron job every 10 minutes
Service accounts:
-
Staging:
me-e2e@ems-mobile-engage-staging.iam.gserviceaccount.com -
Production:
me-e2e@ems-mobile-engage.iam.gserviceaccount.com
Database Migrations
Migrations are managed with goose. To run manually:
make build-migrate
./bin/migrate
Or against a specific database:
DATABASE_URL=postgres://... ./bin/migrate
Building Locally
# Build all binaries
make build-all
# Run tests (also runs migrations)
make test-all
# Regenerate Swagger docs from code comments
make generate-docs