feat: Add CI/CD workflows for deploying GBFS Validator Java API#4
feat: Add CI/CD workflows for deploying GBFS Validator Java API#4
Conversation
…date project structure docs
|
|
| echo "🎉 Setup complete for project $PROJECT_ID" | ||
|
|
||
| # === Global LB IP addresses === | ||
| IPV4_NAME="${ENVIRONMENT}-lb-ipv4" |
There was a problem hiding this comment.
nitpick: I would add gbfs-validator-api-{environment} prefix instead of just environment, but I know that the IPs are already created, so we can discard this comment.
There was a problem hiding this comment.
Agreed it should have been better chosen, but if I'm not mistaken this name is only visible within the project, so the chance of collision with other projects is nil.
There was a problem hiding this comment.
That's correct, but prod-lb-ipv4 is not specific enough. We can have multiple APIs in the same project that require different DNS+IPs.
| echo " Re-run this script after the first successful deployment to apply this binding." | ||
| fi | ||
|
|
||
| # === Enable Artifact Registry API === |
There was a problem hiding this comment.
[out of scope]: In the case of an artifact registry, we should add rules to clean up "old" images.
Closes #2 and #3
Sets up the full CI/CD pipeline and GCP infrastructure bootstrapping for the GBFS Validator Java API across dev, qa, and prod environments.
What's included:
setup-environment.sh— bootstraps a GCP project: enables APIs, creates the deployer SA, sets IAM roles, creates the shared Artifact Registry repo, reserves LB IPs, and provisions a Google-managed SSL certsetup-deployer-sa-permissions.sh— grants Terraform-specific roles to the deployer SA.github/workflows/gbfs-validator-staging.yml— triggers: PR open/sync → dev, push to main → qa, manual dispatch → dev (default) or qa.github/workflows/gbfs-validator-prod.yml— manual dispatch only; deploys to prod.github/workflows/gbfs-validator-deployer.yml— reusable workflow: builds and pushes Docker image to Artifact Registry, then runs Terraforminfra/main.tf— passesproject_idexplicitly tocloud_runandload_balancermodules (critical for prod which uses a different GCP project)README.md— documents the environment structure, GCP setup steps, and deployment triggersNotes:
gbfs.api.mobilitydatabase.org; dev/qa use{env}.gbfs.api.mobilitydatabase.orggbfs-validator-prod; staging environments sharegbfs-validator-stagingTesting:
Since the workflows are not yet on
main, they cannot be triggered from the GitHub Actions web UI. Use theghCLI instead, targeting this branch (see below). You can set a release or snapshot version of gbfs-validator-java. See central.sonatype.com for the available releases. For snapshot unfortunately the snapshot repo cannot be browsed, but you can find some snapshots that were published hereOnce deployed, validate a GBFS feed against each environment:
All three should return a JSON validation report with HTTP 200. The json should also include the gbfs-validator-java version used.