Part 13 · CI/CD, Git & Cloud
CI/CD và microservice deployment: execution labs
Build once/promote, independent service rollout và schema evolution phải chịu được mixed versions, failed migration và rollback.
Lab A · Verified immutable artifact
- Pipeline compile/unit/integration/contract/scan/SBOM/sign/publish.
- Tag artifact bằng commit nhưng deploy theo immutable digest.
- Promote cùng digest dev→staging→production; không rebuild per environment.
- Chạy untrusted PR scenario; assert không có production secret/write credential.
Lab B · Expand–migrate–contract
A: add nullable total_amount
B: deploy code read-old/new and compatible writes
M: backfill batches with checkpoint
C: switch reads using flag, reconcile
D: drop old column after rollback window- Chạy v1/v2 cùng schema; assert cả hai hoạt động.
- Inject migration fail ở batch 3; resume từ checkpoint.
- Canary v2 write new format rồi rollback; xác nhận v1 vẫn đọc được.
- Chạy contract sớm trong test để tái hiện old-pod failure.
Lab C · Independent multi-service release
- Inventory v2 thêm reservation endpoint nhưng giữ v1 API.
- Order v2 deploy flag off; consumer/provider contracts chạy trước deploy.
- Canary flag 1%→10%→100%, gate errors/latency/reservation leaks.
- Telemetry xác nhận old endpoint không còn caller rồi mới deprecate/contract.
Lab D · Terraform delivery
fmt,validate, lint/security/policy và reviewed plan.- Remote encrypted/versioned state + locking; short-lived OIDC identity.
- Inject apply partial failure; refresh/plan và recover without manual blind edits.
- Simulate drift/import/state move trong sandbox fixture.
Deliverables
- Pipeline definition và retained reports/provenance.
- Artifact digest promotion evidence.
- Four-release migration timeline và data reconciliation.
- Contract/canary results cho two-service release.
- Terraform plan/policy/state-recovery evidence.
Execution evidence gate
- Ghi runtime/version, input và hypothesis trước khi chạy; lưu command, config, request ID và raw output.
- Inject failure tại checkpoint xác định và assert invariant từ nguồn độc lập.
- Chạy matrix phù hợp: timing, concurrency, dependency, lifecycle và mixed-version compatibility.
- Kết luận bằng mechanism, trade-off, limitation, recovery/rollback và production decision.
Completion: phân biệt specified, executed, explained và production-ready evidence. Không đánh dấu executed nếu snippet hoặc code chưa thực sự được chạy.