Automated Build • Test • Deploy with Jenkins & Docker
🌐 Live Demo • 📖 Documentation • ⚙️ Setup Guide
Complete CI/CD pipeline with automated build, test, and deployment workflows using Docker containerization and Jenkins orchestration.
🔗 Live Application:
Experience the deployed application built through our automated CI/CD pipeline!
Click to expand
This project implements a complete DevOps lifecycle for Abode Software's web application, featuring:
- ✅ Automated CI/CD Pipeline with Jenkins
- ✅ Docker Containerization for consistent deployments
- ✅ Configuration Management using Ansible
- ✅ Git Workflow with branch-based deployment strategies
- ✅ Automated Testing with comprehensive test suites
- ✅ Production-Ready infrastructure setup
- Implement DevOps best practices for rapid software delivery
- Automate build, test, and deployment processes
- Ensure code quality through automated testing
- Enable continuous integration and continuous deployment (CI/CD)
- Automatic triggering on Git push via webhooks
- Branch-based deployment (master → production, develop → test only)
- Pipeline stages: Build → Test → Deploy
- Rollback capability for failed deployments
- Containerized application for consistency across environments
- Uses
hshar/webappas base image - Health checks and monitoring built-in
- Easy scaling and deployment
- Container health verification
- HTTP endpoint testing
- Application availability checks
- Resource usage monitoring
- Log analysis for errors
- Ansible playbooks for environment setup
- Automated software installation (Docker, Git, Java, Maven)
- Idempotent configuration scripts
- Multi-platform support (Ubuntu/Debian)
- Real-time build status in Jenkins
- Docker container logs
- Test result reporting
- Build history tracking
| Technology | Purpose | Version |
|---|---|---|
| Jenkins | CI/CD orchestration | LTS |
| Docker | Containerization | 24.x |
| Ansible | Configuration management | 2.x |
| Git/GitHub | Version control | 2.x |
| Bash | Scripting & automation | 5.x |
| Maven | Build automation (optional) | 3.x |
| Java | Jenkins runtime | 11 |
jenkins-docker-cicd-pipeline/
│
├── Jenkinsfile # Jenkins pipeline definition
├── Dockerfile # Docker container configuration
├── ansible-playbook.yml # Environment setup automation
├── test.sh # Automated test script
├── Screenshots/
│
├── docs/
│ ├── setup-guide.md # Detailed setup instructions
│ ├── troubleshooting.md # Common issues & solutions
│ ├── Architecture.png # Main Architecture
│ ├── pipeline-config.md # Pipeline Configurations
│ └── windows-quickstart.md # Windows-specific setup
│
└── README.md # This file
- Operating System: Windows 10/11 Pro, Linux, or macOS
- RAM: Minimum 8GB
- Disk Space: At least 20GB free
- Software:
- Docker Desktop (Windows/Mac) or Docker Engine (Linux)
- Git
- Java 11 (for Jenkins)
git clone https://github.com/himanshu2604/jenkins-devops-cicd-pipeline.git
cd jenkins-devops-cicd-pipeline# Run the Ansible playbook to install dependencies
ansible-playbook ansible-playbook.ymlOR Install manually:
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Install Jenkins (using Docker)
docker run -d \
--name jenkins \
-p 8080:8080 \
-p 50000:50000 \
-v jenkins_home:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkins/jenkins:lts- Access Jenkins at
http://localhost:8080 - Get initial password:
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword - Install suggested plugins
- Install additional plugins:
- Docker Pipeline
- Git Plugin
- GitHub Integration Plugin
- New Item → Pipeline
- Name:
Abode-DevOps-Pipeline - Configure:
- Build Triggers: ✓ GitHub hook trigger for GITScm polling
- Pipeline:
- Definition: Pipeline script from SCM
- SCM: Git
- Repository URL:
https://github.com/himanshu2604/jenkins-devops-cicd-pipeline.git - Branches:
*/masterand*/develop - Script Path:
Jenkinsfile
- Go to your GitHub repository → Settings → Webhooks
- Click Add webhook
- Configure:
- Payload URL:
http://YOUR_JENKINS_URL:8080/github-webhook/ - Content type:
application/json - Events: Just the push event
- Active: ✓
- Payload URL:
# Create develop branch
git checkout -b develop
git push origin develop
# Make a test commit
echo "<h1>Test Update</h1>" >> index.html
git add .
git commit -m "Test pipeline trigger"
git push origin develop→ Checkout code from GitHub
→ Stop and remove existing containers
→ Build Docker image
→ Tag image with build number
→ Run container from built image
→ Wait for container to be ready
→ Execute automated tests:
├─ Container health check
├─ HTTP endpoint verification
├─ Application accessibility
└─ Log analysis
IF branch == master:
→ Keep container running (PRODUCTION)
→ Application available on port 8081
IF branch == develop:
→ Stop and remove container (TEST ONLY)
→ No production deployment
git checkout master
# Make changes
git add .
git commit -m "Production update"
git push origin masterResult: Build → Test → Deploy to Production ✅
git checkout develop
# Make changes
git add .
git commit -m "Development update"
git push origin developResult: Build → Test → Stop (No Production Deployment) ⏹️
git checkout develop
git checkout -b feature/new-feature
# Develop feature
git add .
git commit -m "Add new feature"
git push origin feature/new-feature
# Create Pull Request to develop
# After review → Merge to develop
# After testing → Merge develop to master
pipeline {
agent any
stages {
stage('Build') { ... }
stage('Test') { ... }
stage('Deploy to Production') {
when { branch 'master' }
...
}
}
}FROM hshar/webapp
WORKDIR /var/www/html
COPY . /var/www/html/
EXPOSE 8081
CMD ["apachectl", "-D", "FOREGROUND"]#!/bin/bash
# Automated testing suite
# - Container health checks
# - HTTP endpoint verification
# - Application accessibility testsIssue: Jenkins can't connect to Docker
# Solution: Add Jenkins to Docker group
docker exec -u root jenkins usermod -aG docker jenkins
docker restart jenkinsIssue: Port 81 already in use
# Solution: Use different port
docker run -d --name abode-webapp -p 8082:80 hshar/webapp:latestIssue: Webhook not triggering
# Solution: Use ngrok for localhost
ngrok http 8080
# Use ngrok URL in GitHub webhookFor more solutions, see Troubleshooting Guide
This project demonstrates proficiency in:
- ✅ CI/CD pipeline design and implementation
- ✅ Docker containerization and orchestration
- ✅ Jenkins configuration and automation
- ✅ Infrastructure as Code (IaC) with Ansible
- ✅ Git workflow and branching strategies
- ✅ Automated testing and quality assurance
- ✅ DevOps best practices and methodologies
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Himanshu Nitin Nehete
- GitHub: Himasnhu2604
- LinkedIn: Himanshu Nehete
- Email: himanshunehete2025@gmail.com
- Intellipaat for the project requirements
- Jenkins community for excellent documentation
- Docker for containerization technology
- Ansible for automation capabilities
Built with ❤️ using DevOps best practices