This repository contains the source and configuration for a production-like CI/CD pipeline built with Jenkins, SonarQube, Docker, GitHub Webhooks, and AWS EC2. The pipeline automates the path from code commit to deployment, enforcing quality gates and producing reproducible containerized builds.
- Project Overview
- Key features
- Pipeline Workflow
- Prerequisites
- Tech Stack
- Setup instrctions
- What I learned
- Next steps
- Licence
Developed a fully automated CI/CD pipeline designed to streamline software delivery from code commit to production deployment. Every push to the GitHub repository triggers a robust workflow build, test, code quality analysis, and deployment ensuring security, reliability, and seamless integration with AWS infrastructure.
- Trigger builds on every GitHub push via Webhooks
- Run SonarQube static analysis and Quality Gates
- Build & tag Docker images automatically
- Deploy containers to AWS EC2 (or pull from registry)
- Improve release velocity and enforce code quality
- 🖥️ Git & GitHub – Version control + repo management
- ⚙️ Jenkins – Orchestrates the entire CI/CD process
- 🔔 GitHub Webhooks – Triggers pipeline on every push
- 🔍 SonarQube – Code quality & security scanning
- 🐳 Docker – Packaging and consistent deployment
- ☁️ AWS EC2 – Three instances hosting Jenkins, SonarQube & Docker nodes
- Developer commits code → GitHub Repository
- GitHub Webhook → Notifies Jenkins instantly
- Build Stage → Jenkins pulls the repo & compiles
- Quality Gate → SonarQube scans for issues
- Docker Build → Image creation + tagging
- Push/Deploy → Deployed into AWS EC2 automatically
The entire pipeline is designed to be fully re-runnable and scalable.
- GitHub repository for the application
- Jenkins server with plugins: Pipeline, GitHub, Docker Pipeline, SonarQube Scanner, Credentials Binding
- SonarQube server reachable from Jenkins
- Docker installed on build/deploy hosts
- AWS account with EC2 instances (Jenkins, SonarQube optional, Docker host)
- Configured GitHub Webhook pointing to Jenkins
Git | GitHub | Jenkins | Docker | SonarQube | GitHub Webhooks | NGINX Ingress | AWS EC2
Three EC2 instances are used to host the following servers:
- Jenkins Server → Builds an automated pipeline and includes plugins such as SonarQube and SSH2 Easy.
- Docker Server → Deploys the website and makes it accessible to end users.
- SonarQube Server → Performs code quality and security checks.
Each EC2 instance is configured with the necessary dependencies and plugins.
- Generate SSH keys on the Jenkins server:
ssh-keygen -t rsa- Copy the SSH key to the Docker EC2 instance using its public IP address for passwordless authentication:
ssh-copy-id ubuntu@<ip-address>-
Install the SSH2 Easy plugin in Jenkins to manage secure SSH connections.
-
Set up server groups and sites for Jenkins, SonarQube, and Docker.
-
Create a Jenkins job:
- Add the GitHub repository link.
- Specify the branch to build and deploy.
- Add build steps to copy code from Jenkins to SonarQube and Docker instances.
-
Create a Dockerfile and run the following commands:
docker build -t automated-pipeline .docker run -d --name custom-container -p 8085:80 automated-pipeline
- Real-world pipeline debugging (tokens, credentials, agent configs)
- SonarQube quality gates and their role in CI
- Docker image lifecycle and deployment considerations
- Basic cloud deployments and ingress configuration
- Move images to AWS ECR
- Use Terraform for infrastructure-as-code
- Switch to Kubernetes (EKS) for orchestration
- Add Slack/Teams notifications and rollback strategies
This project is licensed under the MIT License.
