Production-Style CI/CD Pipeline Using Jenkins and Docker

I built a Jenkins-driven CI/CD pipeline that automatically builds, tests, containerizes, and deploys a Flask application with safe redeployments and health-verified delivery.

Completed

🔍 Problem Statement

As part of my DevOps and Cloud career transition, I needed to demonstrate practical CI/CD skills beyond theory.

The goal was to design and implement a realistic CI/CD pipeline that:

The solution needed to reflect real-world constraints, such as:

🛠️ Solution Overview

I built a Jenkins-based CI/CD pipeline that automates the entire lifecycle of a Flask application, from source code to a running container.

Key Components

🧱 Architecture Summary

High-Level Flow

Key Design Decision

This ensured safe coexistence on shared infrastructure.

🔄 CI/CD Pipeline Stages

1️⃣ Checkout

  • Jenkins pulls the source code from GitHub
  • Correct Jenkinsfile path (jenkins/Jenkinsfile) is explicitly configured

2️⃣ Build

  • A Python virtual environment is created
  • Application dependencies are installed from requirements.txt

3️⃣ Test

  • Automated tests are executed using pytest
  • Pipeline fails immediately if any test fails

4️⃣ Docker Build

  • A Docker image is built using a lightweight Python base image
  • .dockerignore is used to reduce build context and improve efficiency

5️⃣ Deploy

  • Any existing container is safely removed
  • A new container is started with explicit host-to-container port mapping
  • Deployment is idempotent and safe to re-run

6️⃣ Health Check

  • Jenkins performs an HTTP request to /health
  • The pipeline only succeeds if the application responds correctly

⚠️ Challenges & How I Solved Them

✅ Outcome

The final pipeline runs green only when the application is truly available, not just when containers start.

🧠 Key Learnings

🏁 Conclusion

This project demonstrates my ability to design, debug, and deliver a production-style CI/CD pipeline using Jenkins and Docker. It reflects not only tool familiarity, but also engineering judgment, problem-solving, and real-world deployment awareness.

Explore the raw build 👉🏽