Deploy task (runs after the main build lands)¶
Decisions (Andrew, 2026-11-12):
- Host on the Verse4Verse GCP billing account billingAccounts/01D28B-C2F0EB-2DC50A (display name Verse4Verse; the only open account).
- Use default hostnames only: *.run.app and *.pages.dev. No domain purchase, no DNS changes.
- All infrastructure goes in cdktn C#.
- The apply needs Andrew's explicit approval. Agents run synth and plan only.
Part A: static snapshot mode (the primary demo path; restaurant-proof)¶
FhirDemo.Cli snapshot --out web/public/snapshotwrites JSON for every API response the Vue app needs: patients, summaries, CDS cards, report data, compare data, outbox samples.- In the Vue app,
VITE_DATA_MODE=snapshotreads those JSON files instead of the API. "Run sync again" shows the recorded second-run counts (all unchanged). "Add allergy" builds the FHIR AllergyIntolerance JSON client-side and shows it. - Forge Studio is already static.
- Result: both sites are pure static assets with no backend, no cold start, and no database.
Part B: infrastructure as code (infra/FhirDemo.Deploy, cdktn C#)¶
Follow fleet-infra conventions:
- Terraform = 1.17.1
- GCS backend bucket jones-gaffney-fleet-admin-tfstate, passed by -backend-config, prefix fhir-demo/prod; never hard-coded
- pinned providers google/google-beta/cloudflare (reference: fleet-infra policy/providers.json)
- region us-central1
Stack fhir-demo-gcp:
- google_project fhir-pipeline-demo-<suffix> with billing_account = 01D28B-C2F0EB-2DC50A, plus the services run, artifactregistry, iam and cloudbuild.
- An Artifact Registry docker repo app, with a cleanup policy that keeps the 10 most recent images.
- google_cloud_run_v2_service fhir-demo-api: min 0, max 2, port 8080, its own runtime service account, INGRESS_TRAFFIC_ALL, unauthenticated invoker for the demo (synthetic data only), env Data__Provider=Sqlite.
- A bootstrap image is set at creation only, with ignore_changes on image (the V4V app.tf pattern).
- Budget alert: a google_billing_budget of $10/month on the project.
Stack fhir-demo-cf:
- Two Cloudflare pages_project resources, fhir-pipeline-demo and forge-studio, with direct upload and no Git integration.
- Account id 2a59c9c45db9f7893484b8ed59604979.
Other requirements:
- A Dockerfile for FhirDemo.Api (port 8080, PORT env).
- docs/DEPLOY.md with the exact runbook:
1. cdktn synth
2. terraform plan -out tfplan (per stack)
3. [Andrew approves] terraform apply tfplan
4. Build and push the image with Cloud Build
5. wrangler pages deploy for each site. This is a mutation, so it happens only after approval.
DONE: synth succeeds, and terraform validate plus terraform plan (against the backend, using gcloud auth application-default if available) succeed. If plan can't auth, synth plus validate is enough. The REAL outputs go in docs/VERIFY.md under "Deploy". NEVER run apply, wrangler deploy, or gcloud mutations.
Decisions (Andrew, 2026-11-12, about 8:50 PM CT)¶
- "it can deploy in gcp": the GCP deployment as specified above is approved. That covers a new project on the Verse4Verse billing account, Artifact Registry, a private Cloud Run API, the runtime service account, the $10 budget and the two Cloudflare Pages sites.
- The orchestrator runs
terraform planand applies only if the plan contains exactly those resources. Any extra resource, IAM grant or destroy stops the apply, and it goes back to Andrew. - Repo for Innovare: PRIVATE (Andrew, about 8:55 PM: "Private git front"). Create
andrewjonesdev/fhir-pipeline-demoas private. Invite James and the developer by their GitHub usernames only when Andrew says so. The same scrub applies, because they will read it. Creating it happens after passes 10, 11 and 9 are verified, merged and scrubbed. It is a single fresh commit, released only after the release audit and gitleaks both report zero findings. - Quality bar: "this needs to hold up to all of our code quality". See CODEX-TASK-11.md.
- GitFront (Andrew, about 9:00 PM): Innovare sees the private repo through a GitFront share link (gitfront.io).
- Andrew signs up at console.gitfront.io; agents never create accounts.
- GitFront supplies a deploy key. Add it as read-only with
gh repo deploy-key add <file> --repo andrewjonesdev/fhir-pipeline-demo --title gitfront, without--allow-write. - Andrew is on GitFront Pro (500 MB per repo). The scrubbed tree is about 11.5 MB including lib/EFCore.DuckDB. Repo slots are not a constraint; still ONE repo, so a fresh clone builds on its own. Click "build" once on the final verified commit, so builds are not burned while iterating.
- Anyone with the link can read it, and GitFront doesn't say whether the link is indexed. So the scrub is held to the PUBLIC standard: the release audit and gitleaks must both report zero findings.
- Revoke: delete the deploy key on GitHub, and the project in GitFront.
- License (Andrew, about 9:10 PM): all rights reserved for the whole Innovare repo, including EFCore.DuckDB, while it is private. It may change later. Third-party licenses are preserved in THIRD-PARTY-NOTICES.md.