πŸ”—CI/CD Demystified

Abheeshta PAbheeshta P
3 min read

πŸ” Continuous Integration (CI)

Goal: Catch bugs early during development.

πŸ“Œ What it means:
Every time you or your team writes code and pushes to Git, automated tests, linters, and build scripts run automatically.

πŸ§ͺ Includes:

  • Unit tests

  • Lint checks

  • Build checks

πŸ› οΈ Tools:

  • GitHub Actions, Jenkins, CircleCI, GitLab CI

πŸ“¦ Example:
You push a login feature to GitHub β†’ GitHub Actions runs tests β†’ If everything passes, the code is ready for staging.

🚚 Continuous Delivery (CD)

Goal: Always have a production-ready codebase.

πŸ“Œ What it means:
After CI, your code can be manually deployed anytime β€” it’s always ready to ship.

βœ… Run tests not just on main, but on every commit (feature branches too).

πŸ› οΈ Tools:

  • Spinnaker, GitLab, ArgoCD, Flux

πŸ“¦ Example:
You fix a bug β†’ GitHub Actions runs tests β†’ code is merged to main β†’ a button in the dashboard lets the team deploy it to prod when ready.

πŸš€ Continuous Deployment (CD)

Goal: Automatically deploy every successful commit to production β€” no human click needed.

πŸ“Œ What it means:
Once code passes all tests + security checks β†’ it's pushed live for users.

πŸ§ͺ Still, there’s risk of bugs (even with 99% test coverage), so smart deployment strategies are used:


Deployment Strategies

1. Canary Deployment

Rollout to a small subset of users (e.g., 5% β†’ 10% β†’ 50% β†’ 100%)
🟒 Safer β†’ Easy to rollback if bugs detected

πŸ“¦ Example:
Your new UI is first shown to only 10% of users. You monitor errors & feedback. If it’s smooth, rollout increases.

πŸ› οΈ Tools:

  • LaunchDarkly, Argo Rollouts, Istio, Flagger

2. Blue-Green Deployment

Two environments:

  • Blue = current version

  • Green = new version

πŸ“Œ Users are gradually shifted from Blue β†’ Green.

πŸ§ͺ You test Green β†’ Switch DNS/load balancer β†’ Done!

πŸ“¦ Example:
New checkout flow is deployed to Green. You test it live while users are still on Blue. Once verified, you flip the switch.

πŸ› οΈ Tools:

  • Kubernetes, NGINX, AWS CodeDeploy, Spinnaker

🎯 Final Real-World Flow

  1. Developer pushes code β†’ CI (GitHub Actions runs tests)

  2. CD kicks in β†’ Auto deploys to staging β†’ Manual/Auto deploy to prod

  3. Canary rollout begins β†’ Monitored via dashboards

  4. If smooth β†’ 100% rollout

  5. Issues? β†’ Rollback or redirect traffic to older version (Blue)


Using Jenkins for CI/CD & Deployment

Jenkins is one of the most widely-used automation servers for CI/CD. It’s open-source, highly customizable, and integrates with almost everything.

πŸ› οΈ Jenkins Pipeline Flow:

Let’s say you're deploying a new login feature:

🧱 Step-by-step Jenkins Setup:

  1. πŸ§‘β€πŸ’» Developer pushes code to GitHub.

  2. πŸ§ͺ Jenkins Job (CI) triggers automatically:

    • Pulls code

    • Runs unit tests

    • Linting

    • Builds the app (maybe Docker image)

  3. βœ… If CI passes, Jenkins moves to CD pipeline:

    • Deploys to Staging server

    • Runs integration tests

    • Sends approval request (for Continuous Delivery) OR

    • Auto deploys to Production (for Continuous Deployment)

Tools Jenkins Works With:

  • GitHub/GitLab/Bitbucket – Code repo

  • Docker – Build & push images

  • Kubernetes – Container orchestration

  • ArgoCD/Spinnaker – Rollouts

  • Slack/Email – Notifications

  • SonarQube – Code quality check

Final Summary (CI/CD with Jenkins):

StageWhat HappensJenkins Role
CICode pushed, tests & build runAutomates test & build pipeline
CDReady code auto/manual deploysHandles deployment to staging/prod
Deployment StrategyCanary/Blue-GreenCoordinates with tools like Argo, NGINX

Thanks for reading!

10
Subscribe to my newsletter

Read articles from Abheeshta P directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Abheeshta P
Abheeshta P

I am a Full-stack dev turning ideas into sleek, functional experiences πŸš€. I am passionate about AI, intuitive UI/UX, and crafting user-friendly platforms . I am always curious – from building websites to diving into machine learning and under the hood workings ✨. Next.js, Node.js, MongoDB, and Tailwind are my daily tools. I am here to share dev experiments, lessons learned, and the occasional late-night code breakthroughs. Always evolving, always building.