Shelves / DevOps, CI/CD and IaC
DL·97
Delivery Projects
Eight build-it-yourself projects that give the tiffin centre a complete delivery system: a disciplined Git workflow, a fast trustworthy CI pipeline, a secure supply chain, infrastructure as code with drift detection, GitOps for every environment, progressive delivery, automated releases, and a DORA dashboard, each with milestones, measurable definitions of done and stretch goals.
How to approach the projects
One delivery system, end to end
The labs in this volume took one mechanism at a time. These projects connect them into the path every change to the tiffin centre's services takes: commit, review, CI, artifact, infrastructure, environments, release, measurement. Use GitHub or GitLab (free tiers are enough), a small Kubernetes cluster (k3s, kind or a managed one), OpenTofu or Terraform, and Argo CD or Flux.
| # | Project | Main chapters | Roughly |
|---|---|---|---|
| 1 | A Git workflow with guard rails | 92 | a weekend |
| 2 | A fast, trustworthy CI pipeline | 93 | 1 week |
| 3 | A secure supply chain | 93, 81 (Vol. 6) | 1 week |
| 4 | Infrastructure as code with drift detection | 94 | 1–2 weeks |
| 5 | GitOps for three environments | 95 | 1 week |
| 6 | Progressive delivery with automated analysis | 95, 84 (Vol. 6) | 1 week |
| 7 | Automated releases and safe migrations | 96 | 1 week |
| 8 | Measuring delivery: a DORA dashboard | Start Here, 93 | 1 week |
New to delivery? Do them in order. Experienced? Skim 1–2 and treat the stretch goals of 3–8 as the assignment.
The working method
- Everything in Git, including pipeline definitions, infrastructure, manifests and policies.
- Write the definition of done first, as checks a script or a pipeline can run.
- Measure: pipeline durations, flake rates, deployment frequency, lead time, change failure rate and time to restore are numbers you collect, not opinions.
- Break it on purpose: bad commits, failing tests, leaked fake secrets, drift, broken releases.
- Write a README per project with decisions, alternatives and measurements.
The eight projects
Project 1: a Git workflow with guard rails
Goal. A repository that makes the right thing easy and the wrong thing hard.
Milestones. Trunk-based workflow with short-lived branches → branch protection: required reviews, required status checks, linear history or merge queues → Conventional Commit messages enforced by a commit-msg hook and a CI check → pre-commit hooks for formatting, large files and secret detection → signed commits (SSH or Sigstore) with verification → CODEOWNERS.
Done when. A direct push to main, an unsigned commit, a commit with a 10 MB file and a commit containing a fake AWS key are each rejected (by hook, CI or server) with a clear message; the median pull request merges within one working day of opening.
Stretch. A merge queue (GitHub merge queue or GitLab merge trains) with a measured reduction in broken main builds; a monorepo with sparse checkout and path-based CI.
Project 2: a fast, trustworthy CI pipeline
Goal. Feedback on every pull request in under 10 minutes that people believe.
Milestones. Lint, unit and integration tests (with Testcontainers or service containers) → caching keyed on lock files → parallel jobs and test sharding → test reports and coverage as artifacts → flaky-test detection (rerun failures, record per-test flake rates) and a quarantine process → required checks on pull requests.
Done when. The p50 pipeline is under 10 minutes and p90 under 15 for 50 consecutive runs; a warm-cache run is at least 3× faster than a cold one; the flake rate is under 1% of runs, measured, with every quarantined test owned and dated.
Stretch. Build-system remote caching (Gradle or Bazel); test impact analysis running only affected tests; self-hosted autoscaling runners with ephemeral VMs or pods.
Project 3: a secure supply chain
Goal. Every artifact is traceable, scanned and signed, and only those artifacts run.
Milestones. Minimal images built once per commit and tagged by digest → SBOMs and vulnerability scans with a failing threshold → signing with cosign keyless (OIDC from CI) and SLSA provenance attestations → OIDC to the cloud instead of stored keys → pinned third-party actions and least-privilege permissions → admission control in the cluster (Kyverno or Sigstore policy-controller) verifying signatures.
Done when. An unsigned image or one built outside CI is rejected by the cluster; CI holds zero long-lived cloud credentials; the provenance of a running image can be traced to its commit, workflow run and builder in under a minute; a planted critical CVE fails the build.
Stretch. SLSA Build Level 3 with an isolated builder; dependency update automation (Renovate) with auto-merge for patch updates that pass CI.
Project 4: infrastructure as code with drift detection
Goal. All cloud and cluster infrastructure defined, reviewed and checked as code.
Milestones. OpenTofu/Terraform modules for network, cluster, database and buckets → remote state with locking and encryption, split by environment and component → plans posted on pull requests and applied from CI after approval → policy checks on plans (OPA/conftest or Checkov) → scheduled drift detection that opens an issue → import and moved blocks for refactors.
Done when. An environment can be created from empty and destroyed by the pipeline; a manual console change is reported within 24 hours; a plan that destroys a stateful resource or opens 0.0.0.0/0 on a non-HTTPS port fails policy; no secret appears in plain text in any state file.
Stretch. Crossplane or Terraform controllers managing infrastructure from the cluster; per-PR ephemeral environments with automatic teardown.
Project 5: GitOps for three environments
Goal. Dev, staging and production defined in Git and reconciled by Argo CD or Flux.
Milestones. A config repository with Kustomize bases and overlays (or Helm values) per environment → an agent per cluster or one with ApplicationSets → CI updating image tags by pull request (or image automation) → promotion from staging to production by PR with approvals → secrets with SOPS, Sealed Secrets or External Secrets → sync status and drift notifications.
Done when. A merged commit reaches dev within 5 minutes with no manual commands; production changes only through approved PRs; a manual kubectl edit in production is reverted and reported; recreating the staging cluster from Git takes under 30 minutes.
Stretch. Multi-cluster delivery to two regions; cluster add-ons (ingress, cert-manager, monitoring) managed the same way.
Project 6: progressive delivery with automated analysis
Goal. Releases that roll themselves back when metrics go bad.
Milestones. Argo Rollouts or Flagger for the main service → canary steps (10%, 25%, 50%, 100%) with traffic split by a gateway or mesh → analysis templates querying Prometheus for error rate and p99 latency against the stable version → automatic abort and rollback → feature flags (OpenFeature with a provider) for user-facing changes.
Done when. Ten good releases promote automatically; a release with a deliberate 3% error rate is aborted before 25% of traffic and rolled back within 5 minutes, with zero manual steps; a feature can be enabled for 10% of users and disabled in seconds without a deploy.
Stretch. Blue/green for a service with long-lived connections; shadow traffic testing of a new version.
Project 7: automated releases and safe migrations
Goal. Releases that are routine, documented and reversible.
Milestones. Versions and changelogs computed from Conventional Commits (release-please, semantic-release or git-cliff) → signed tags and GitHub/GitLab releases with artifacts → a migration tool (Flyway, Liquibase, Atlas or golang-migrate) run as a separate pipeline step with lock_timeout and statement_timeout → migration linting (squawk) in CI → a documented rollback and roll-forward procedure → deprecation process with headers and usage metrics.
Done when. A release requires no manual editing of versions or changelogs; a column rename ships as an expand–contract sequence of four releases, each rolled back once to prove it; an unsafe migration (plain CREATE INDEX on the orders table) fails CI.
Stretch. A release train with a fixed cadence and automated release notes per service; long-term-support branches with automated backports.
Project 8: measuring delivery
Goal. A dashboard of the four DORA metrics from real data.
Milestones. Collect deployment events (from the GitOps agent or CI), commit timestamps, incidents and rollbacks → compute deployment frequency, lead time for changes, change failure rate and time to restore per service → dashboard and weekly trend → one improvement experiment driven by the data.
Done when. The four metrics update automatically for every service; their definitions are written down; one experiment (for example, splitting a slow test job or adding a merge queue) improved a metric by a measured amount.
Stretch. Add flow metrics (cycle time, WIP) and developer-experience survey data; compare teams without turning metrics into targets.
Tracking your progress
Portfolio checklist
Keep the application, config and infrastructure repositories with their pipelines, policies and a README per project. Delivery evidence is about speed and safety together: "p50 PR feedback 7 min, flake rate 0.4%; zero long-lived CI credentials; unsigned images rejected at admission; drift reported within 24 h; bad canary aborted at 10% in 4 min; deployment frequency 6/day, lead time 3 h, change failure rate 4%, time to restore 18 min" is what makes a delivery portfolio credible.
Mapping to mastery levels
Completing projects 1–3 with their checks puts you at L2 across the volume. Doing their stretch goals and explaining each mechanism is L3–L4. Designing and defending projects 4–8 (IaC and environment layout, GitOps repository design, progressive delivery, release policy, delivery metrics) is L5 work, the level platform engineering and DevOps lead interviews probe.