Backend Deployment Method - Current Practice
Summary
Primary Method: Manual Source Deploy (Option 2 fromdocs/DEPLOYMENT.md)
Service: payroll-pipeline-cbs (Config Plane legacy/compat label; canonical map: payroll-pipeline-cbs-api in GCP_STACK_BASELINE)
Status: This is the hardened, production-tested method
Current Deployment Method (PRIMARY)
Method: gcloud run deploy --source .
Why this method:
- ✅ Builds and deploys in one step (no separate image build)
- ✅ Uses Cloud Build automatically (no Docker required locally)
- ✅ Fastest and most reliable method
- ✅ This is what’s actually used in practice (per
docs/DEPLOYMENT.mdline 101)
Command (from docs/DEPLOYMENT.md):
Phase 8E Enhanced Version (adds resource limits):
- Adds explicit resource limits (memory, CPU, instances, timeout, concurrency)
- Same core deployment method (
--source .)
Alternative Methods (Not Primary)
Option 1: Cloud Build via cloudbuild.yaml
Status: May not be operational (per docs: “Git-triggered Cloud Build may not be operational”)
Command:
- Requires Cloud Build triggers to be configured
- More complex setup
- Not the method actually used in practice
Option 3: Manual Image Build + Deploy (Fallback)
Status: Only if--source . is unavailable
Command:
- Requires Docker locally
- Two-step process (build then deploy)
- Slower than
--source .
Critical Requirements
1. MANDATORY: GIT_COMMIT_SHA for Audit-Grade Provenance
Every deployment MUST include:2. Required Environment Variables
GCP_PROJECT_ID=payroll-bi-gauntlet(must be exact, no spaces)CORS_ORIGINS=https://payroll-pipeline-cbs.vercel.appGIT_COMMIT_SHA=${FULL_SHA}(mandatory)
3. Required Secrets
JWT_SECRET_KEY=jwt-secret:latest
4. Service Account
sa-worker@payroll-bi-gauntlet.iam.gserviceaccount.com
Post-Deploy Verification
1. Verify Revision Changed
latestReadyRevisionNameshould change after deploystatus.urlshould behttps://payroll-pipeline-cbs-evndxpcirq-uc.a.run.app
2. Verify Provenance (MANDATORY)
Run the provenance verification script above.3. Health Check
Comparison: Hardened vs Phase 8E Script
| Aspect | Hardened Method | Phase 8E Script |
|---|---|---|
| Core Method | --source . | --source . ✅ Same |
| GIT_COMMIT_SHA | ✅ Included | ✅ Included |
| Resource Limits | ❌ Not specified | ✅ Memory, CPU, instances |
| Service Account | ✅ Correct | ✅ Correct |
| Secrets | ✅ Correct | ✅ Correct |
| Env Vars | ✅ Correct | ✅ Correct |
Recommendation for Phase 8E Deployment
Use the Phase 8E script version (with resource limits) because:- ✅ Uses the same hardened
--source .method - ✅ Includes all mandatory flags (GIT_COMMIT_SHA, secrets, env vars)
- ✅ Adds explicit resource limits (better for production)
- ✅ Includes service URL verification
- ✅ Captures previous revision for rollback
Last Updated: 2026-01-18 Source:
docs/DEPLOYMENT.md (lines 99-118) + scripts/phase8e_deploy_backend.sh