CI/CD Concepts

Here are my notes on CI/CD.

Table of Contents

  1. Core CI Stages
    1. Source checkout & environment setup
    2. Static analysis & linting
    3. Formakbding & code quality gates
    4. Building & packaging
    5. Testing
    6. Code coverage & test reporting
  2. Artifact & environment management
    1. Artifact storage
    2. Configuration & secrets
  3. CD / Deployment Stages
    1. Staging / test environment deployment
    2. Deployment strategies
    3. Production deployment
  4. Post-deploy & operations
    1. Verification & monitoring
    2. Rollback & recovery
  5. Supporting pipeline features
    1. Caching & optimization
    2. Branch / environment policies
    3. Notifications & reporting
  6. Example high-level flow (simplified)

Core CI Stages

Source checkout & environment setup

  1. Fetch code from VCS (e.g. git clone, checkout specific commit or PR)
  2. Restore or install dependencies (e.g. language packages, system packages)
  3. Set up build tools (compilers, SDKs, build caches)

Static analysis & linting

Formakbding & code quality gates

Building & packaging

  1. Compile / build:
    1. Frontend bundles (e.g. webpack, vite, rollup)
    2. Backend binaries or artifacts (e.g. maven, gradle, msbuild, cargo)
  2. Package:
    1. Containers (e.g. Docker images)
    2. Language-specific artifacts (e.g. .jar, .whl, .gem, .tgz)
    3. OS packages (e.g. .deb, .rpm)
  3. Versioning & tagging (e.g. semantic versioning, git tags)

Testing

Code coverage & test reporting

  1. Collect coverage (e.g. lcov, coverage.py, jacoco)
  2. Publish coverage and test reports (HTML, JUnit XML, etc.)
  3. Enforce minimum coverage or “no drop in coverage” rules

Artifact & environment management

Artifact storage

  1. Store build outputs in an artifact repository:
    1. Docker/image registry
    2. Binary repository (e.g. Artifactory, Nexus, GitHub Packages)
    3. CI artifact storage (for logs, reports, temporary builds)

Configuration & secrets

CD / Deployment Stages

Staging / test environment deployment

  1. Deploy built artifact to:
    1. Test/staging Kubernetes namespace
    2. Test VMs or PaaS (e.g. Heroku, Cloud Run)
  2. Run smoke/E2E tests against staging
  3. Data / schema migrations in non-prod

Deployment strategies

Common strategies in CI/CD:

Production deployment

Post-deploy & operations

Verification & monitoring

Rollback & recovery

Supporting pipeline features

Caching & optimization

Branch / environment policies

Notifications & reporting

Example high-level flow (simplified)

  1. Checkout code and restore dependencies
  2. Run linters and static analysis
  3. Build artifacts (binary / container)
  4. Run unit and integration tests
  5. Publish artifacts to registry
  6. Deploy to staging environment
  7. Run smoke/E2E tests on staging
  8. With approval, deploy to production (blue–green/canary/rolling)
  9. Monitor and rollback automatically if needed

Copyright ©2023-2026 Søren Lund
Last modified on Wednesday, Apr 1, 2026


Get it on Codeberg