A complete DevOps project demonstrating automated build, test, and deployment using Jenkins, Docker, and KVM virtualization.
This project implements a full CI/CD pipeline that automatically builds, tests, and deploys a containerized Flask web application. The infrastructure includes virtualized servers managed with KVM and cloud-init, showcasing Infrastructure as Code principles.
Live Demo: [Note: Add screenshot or video link]
┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Developer │─────▶│ Jenkins │─────▶│ Production │
│ (Git) │ │ Server │ │ Server │
│ │ │ │ │ │
│ Code Push │ │ Build, Test │ │ Docker │
│ │ │ Docker Image │ │ Container │
└─────────────┘ └──────────────┘ └─────────────────┘
│
▼
Automated Health
Checks & Monitoring
- CI/CD: Jenkins
- Containerization: Docker, Docker Compose
- Application: Python Flask, JavaScript, HTML/CSS
- Virtualization: KVM/libvirt
- Automation: cloud-init, Bash scripting
- Version Control: Git
- OS: Ubuntu Server 22.04 LTS
- Networking: NAT, SSH
- Security: SSH key authentication, credential management
- ✅ Automated CI/CD Pipeline - Builds and deploys on code changes
- ✅ Containerized Application - Consistent environments with Docker
- ✅ Infrastructure as Code - Reproducible VM provisioning with cloud-init
- ✅ Automated Testing - Health checks prevent bad deployments
- ✅ Zero-Downtime Deployment - Rolling updates with minimal interruption
- ✅ Monitoring - Continuous health checks and logging
- ✅ Security - SSH key-based authentication throughout
- Linux host (tested on OpenMandriva Lx)
- KVM/libvirt virtualization support
- 16GB+ RAM (32GB recommended)
- 50GB+ free disk space
- Docker installed
You can run the task manager application locally without setting up the full CI/CD infrastructure:
git clone https://github.com/Jobdm/devops-cicd-pipeline.git
cd devops-cicd-pipeline/app
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run application
python app.pyOpen your browser to http://localhost:5000
# Build image
docker build -t task-manager:latest -f docker/Dockerfile .
# Run container
docker run -d -p 5000:5000 --name task-manager task-manager:latest
# View logs
docker logs task-manager
# Stop container
docker stop task-manager && docker rm task-managerOpen your browser to http://localhost:5000
To replicate the complete CI/CD pipeline with automated deployment infrastructure:
- Linux host with KVM/libvirt virtualization
- 16GB+ RAM (32GB recommended for smooth operation)
- 50GB+ free disk space
- Docker installed on host
- Basic command line proficiency
- Time commitment: 8-12 hours total
This project demonstrates a complete DevOps workflow:
-
Infrastructure Layer
- 2 KVM virtual machines provisioned with cloud-init
- Network configuration and SSH key authentication
- Automated VM initialization
-
CI/CD Pipeline
- Jenkins automation server
- Automated Docker image builds
- Continuous testing with health checks
- Automated deployment to production
-
Monitoring
- Health check endpoints
- Automated monitoring with logging
- Deployment verification
Phase 1: Application & Containerization (~2-3 hours)
- Build and test Flask application
- Create Docker containers
- See Quick Start above
Phase 2: Infrastructure Provisioning (~3-4 hours)
- Create and configure virtual machines
- Set up networking and SSH keys
- Provision with cloud-init
- Detailed guide: INFRASTRUCTURE.md
Phase 3: Jenkins CI/CD Pipeline (~3-4 hours)
- Install and configure Jenkins
- Create automated pipeline
- Configure deployment automation
- Detailed guide: PIPELINE.md
┌──────────────┐ ┌───────────────┐ ┌──────────────────┐
│ Developer │──────▶│ Jenkins VM │──────▶│ Production VM │
│ Workstation│ │ │ │ │
│ │ │ • Build │ │ • Docker Runtime │
│ • Git commits│ │ • Test │ │ • Application │
│ • Code review│ │ • Deploy │ │ • Monitoring │
└──────────────┘ └───────────────┘ └──────────────────┘
# 1. Download Ubuntu cloud image
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# 2. Create cloud-init configurations
# See vm-configs/ directory for templates
# 3. Provision VMs with virt-install
# See INFRASTRUCTURE.md for commands
# 4. Install Jenkins on Jenkins VM
# See PIPELINE.md for installation steps
# 5. Configure and run pipeline
# Jenkinsfile included in repositoryFor complete step-by-step instructions, see the documentation in /docs.
If you want to explore the concepts without full infrastructure:
- Use Docker Compose to run multiple containers locally
- Use Minikube for local Kubernetes learning (future enhancement)
- Deploy to cloud platforms (AWS, Azure, GCP) instead of local VMs
task-manager-pipeline/
├── app/ # Flask application
│ ├── app.py # Backend API
│ ├── requirements.txt # Python dependencies
│ ├── templates/ # HTML templates
│ └── static/ # CSS, JavaScript
├── docker/ # Container configuration
│ ├── Dockerfile # Image definition
│ └── docker-compose.yml # Multi-container setup
├── vm-configs/ # Infrastructure as Code
│ ├── jenkins/ # Jenkins VM config
│ └── production/ # Production VM config
├── docs/ # Documentation
│ ├── INFRASTRUCTURE.md # VM architecture
│ └── PIPELINE.md # CI/CD details
└── Jenkinsfile # Pipeline definition
The Jenkins pipeline automates deployment through five stages:
- Build - Creates Docker image from source code
- Test - Runs health checks to verify functionality
- Save - Exports image for transfer
- Deploy - Pushes to production and starts new container
- Verify - Confirms successful deployment
Deployment Time: ~2-3 minutes from commit to production
# Run application tests
cd app
source venv/bin/activate
python -m pytest tests/
# Health check endpoint
curl http://localhost:5000/health
# Load test (if you add one)
ab -n 1000 -c 10 http://localhost:5000/Health checks run every 5 minutes via cron:
- Endpoint:
/health - Logs:
/var/log/production-health.log - Metrics: Response time, availability
- SSH key-based authentication (no passwords)
- Credentials stored in Jenkins credential manager
- Network isolation via NAT
- Minimal base images (python:3.11-slim)
- Regular security updates via cloud-init
Note: This is a learning/demo project. Production deployments would require:
- TLS/SSL certificates
- Secrets management (HashiCorp Vault)
- Network segmentation
- WAF and DDoS protection
- Comprehensive logging and alerting
This project demonstrates proficiency in:
- DevOps Practices: CI/CD, Infrastructure as Code, automation
- Containerization: Docker image building, multi-stage builds
- Linux Administration: VM management, networking, security
- Scripting: Bash, Python for automation
- Version Control: Git workflows, branching strategies
- Problem Solving: Debugging, troubleshooting, documentation
Potential improvements for production readiness:
- Kubernetes deployment for orchestration
- Prometheus + Grafana for advanced monitoring
- Multi-environment strategy (dev/staging/prod)
- Blue-green deployment strategy
- Automated rollback on failure
- Integration with cloud providers (AWS/Azure/GCP)
- Secret management with Vault
- Automated security scanning
Detailed documentation available in /docs:
- INFRASTRUCTURE.md - VM architecture and management
- PIPELINE.md - CI/CD pipeline details and troubleshooting
This is a personal learning project, but suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit changes (
git commit -m 'Add improvement') - Push to branch (
git push origin feature/improvement) - Open a Pull Request
This project is open source and available under the MIT License.
Job Morales
- GitHub: @Jobdm
- LinkedIn: job-morales
- Email: jobd.morales@gmail.com
- Built as a learning project to demonstrate DevOps skills
- Inspired by real-world production infrastructure patterns
- Technologies chosen based on industry standards
⭐ If you find this project helpful, please consider giving it a star!

