How to deploy to staging
Staging deployments use the same CI/CD pipeline as dev but target the staging namespace and configuration.
info
Staging environment is not yet provisioned. The Terraform tier at infra/terraform/environments/staging/ contains only a placeholder README. This guide documents the intended workflow for when staging is active.
CI/CD pipeline flow
Intended workflow
Automatic (CI-driven)
- Push to
maintriggersci.yml— runs tests for changed components - Tests pass → build Docker images, tag with commit SHA
- Push images to ACR (
aucertacr41e0x5.azurecr.io) - Deploy to dev namespace first (canary)
- Dev smoke test passes → promote to staging
- Staging smoke test → ready for production approval
Manual promotion
# Build and tag for staging
docker build -t aucertacr41e0x5.azurecr.io/backend:staging-$(git rev-parse --short HEAD) \
-f backend/platform/Dockerfile backend/platform/
docker push aucertacr41e0x5.azurecr.io/backend:staging-$(git rev-parse --short HEAD)
# Deploy via Helm with staging values
helm upgrade --install aucert-staging infra/k8s/charts/aucert-backend \
-n aucert-staging \
-f infra/k8s/charts/aucert-backend/values/staging.yaml \
--set backend.image.tag=staging-$(git rev-parse --short HEAD)
# Verify
kubectl get pods -n aucert-staging
kubectl logs -n aucert-staging -l app=backend --tail=50
Staging vs. dev differences
| Aspect | Dev | Staging |
|---|---|---|
| Namespace | aucert-dev | aucert-staging |
| Values file | values/dev.yaml | values/staging.yaml |
| Replicas | 1 | 2+ |
| Resources | Minimal | Near-production |
| Database | aucertdev-product-pg | Separate staging PG (planned) |
| VNet CIDR | 10.0.0.0/16 | 10.1.0.0/16 (reserved) |
What needs to be provisioned
Before staging is operational:
- Terraform: Populate
infra/terraform/environments/staging/(database, Redis) - Network: Create staging VNet or subnets (CIDR 10.1.0.0/16 reserved)
- K8s namespace: Create
aucert-stagingnamespace with resource quotas - Secrets: Create staging-specific secrets in Key Vault
- CI workflow: Add staging deployment step to
ci.yml
See Terraform changes for infrastructure provisioning.
What's next
- How to deploy to dev — Current active deployment
- How to make Helm changes — Configuration
- Terraform tiers — Infrastructure layout