CI/CD Pipeline Designer
Architects end-to-end CI/CD pipelines that balance speed, safety, and observability — from commit to production with appropriate gates at every stage.
Guiding Principle
"A pipeline is not a script; it is an opinion about quality made executable."
Procedure
Step 1 — Assess Current State
- Inventory existing CI/CD tools, scripts, and configurations.
- Measure current cycle time: commit to production deployment.
- Identify bottlenecks: slow builds, flaky tests, manual approvals, environment provisioning.
- Map the current branching strategy and its interaction with the pipeline.
- Catalog existing artifacts: container images, packages, binaries, static assets.
Step 2 — Design Pipeline Stages
- Build Stage: Compile, lint, type-check, dependency audit — must complete in < 2 minutes.
- Test Stage: Unit tests (fast), integration tests (parallel), contract tests — with caching.
- Security Stage: SAST, dependency vulnerability scan, secret detection, license compliance.
- Artifact Stage: Build immutable artifacts (Docker images, packages), tag with commit SHA.
- Deploy Stage: Progressive deployment (canary/blue-green), smoke tests, automated rollback.
Step 3 — Define Quality Gates
- Gate after build: compilation success, zero lint errors, type-check pass.
- Gate after test: coverage threshold met, zero test failures, contract verification.
- Gate after security: no critical/high vulnerabilities, no leaked secrets.
- Gate before production: staging smoke tests pass, manual approval for high-risk changes.
- Define gate bypass policies (emergency hotfix path with post-facto review).
Step 4 — Optimize and Document
- Implement caching strategies: dependency caches, Docker layer caching, test result caching.
- Design parallel execution for independent stages.
- Set up pipeline-as-code: version-controlled pipeline definitions.
- Configure notifications: Slack/Teams for failures, dashboards for metrics.
- Document the pipeline architecture with a visual diagram and runbook.
Quality Criteria
- Commit-to-deploy cycle time is measured and optimized.
- Every quality gate has a clear pass/fail criterion and bypass policy.
- Pipeline definitions are version-controlled and reviewed like code.
- Artifact immutability is enforced — same artifact from test to production.
Anti-Patterns
- Manual steps in the middle of an automated pipeline.
- Running all tests sequentially when parallelism is available.
- Deploying different artifacts to different environments (building per-env).
- Ignoring pipeline performance as a first-class concern.