Skip to content

Cicd_overview

CI/CD stands for Continuous Integration and Continuous Delivery (or Deployment). It’s a methodology that automates the process of integrating code changes and delivering them to production.

┌─────────────────────────────────────────────────────────────────────────────┐
│ CI/CD Pipeline │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Code │───▶│ CI │───▶│ CD │───▶│ Staging│───▶│Production│ │
│ │ Commit │ │ Build & │ │Deliver │ │ Test │ │ Deploy │ │
│ │ │ │ Test │ │ │ │ │ │ │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │
│ CI: Continuous Integration │
│ CD: Continuous Delivery (or Deployment) │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ Continuous Integration │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Developer 1 Developer 2 Developer 3 │
│ │ │ │ │
│ └─────────────┼─────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Code Repo │ │
│ │ (Git) │ │
│ └──────┬───────┘ │
│ │ │
│ │ Push │
│ ▼ │
│ ┌──────────────┐ │
│ │ CI Server │ │
│ │ │ │
│ │ ┌──────────┐ │ │
│ │ │ Build │ │ Compile, lint, test │
│ │ └──────────┘ │ │
│ │ ┌──────────┐ │ │
│ │ │ Test │ │ Unit, integration tests │
│ │ └──────────┘ │ │
│ │ ┌──────────┐ │ │
│ │ │ Package │ │ Create artifacts │
│ │ └──────────┘ │ │
│ └──────┬───────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Artifacts │ │
│ │ Docker Image│ │
│ │ JAR/ZIP │ │
│ └──────────────┘ │
│ │
│ Benefits: │
│ ✓ Detect issues early │
│ ✓ Automated testing │
│ ✓ Consistent builds │
│ ✓ Faster feedback │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ Continuous Delivery vs Continuous Deployment │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Continuous Delivery: │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Build │───▶│ Test │───▶│ Stage │───▶│ Ready │ │
│ │ │ │ │ │ │ │ for Prod│ │
│ └─────────┘ └─────────┘ └─────────┘ └────┬────┘ │
│ │ │
│ Manual Approval ────┘ │
│ │
│ Continuous Deployment: │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Build │───▶│ Test │───▶│ Stage │───▶│Production│ │
│ │ │ │ │ │ │ │ Auto │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │
│ Fully automated after commit │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ Pipeline Stages │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 1. Source │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Code push → Trigger pipeline → Clone repository │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ 2. Build │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Compile code → Package application → Create Docker image │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ 3. Test │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Unit tests → Integration tests → Security scans → Performance │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ 4. Deploy │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Deploy to staging → Run smoke tests → Deploy to production │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ 5. Monitor │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Track metrics → Alert on failures → Rollback if needed │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ CI/CD Tools │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Open Source: │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Jenkins │ │GitLab CI │ │ CircleCI│ │ Travis │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ Enterprise: │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Jenkins X │ │ GitHub Actions│ │ Azure DevOps │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ Cloud-Native: │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ AWS CodePipeline │ Google Cloud Build │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

In this chapter, you learned:

  • What is CI/CD
  • Continuous Integration (CI)
  • Continuous Delivery vs Deployment
  • Pipeline stages
  • CI/CD tools overview