This project demonstrates a complete CI/CD pipeline using Jenkins, Maven, SonarQube, Docker, Docker Hub, and Google Kubernetes Engine (GKE). It automates building a Java application, performing code quality checks, containerizing it, and deploying it to a Kubernetes cluster on GCP.
- Java + Maven β Application build and dependency management
- SonarQube β Code quality analysis
- Jenkins β Orchestration of the pipeline
- Docker β Containerization of the application
- Docker Hub β Container registry to store and pull images
- GCP (GKE) β Kubernetes cluster for deployment
- Terraform (optional) β Infrastructure provisioning for GKE
** CI/CD Workflow**
Jenkinsfile Highlights:
-
Clone Git Repo
-
Build with Maven
-
Run SonarQube Analysis
-
Build Docker Image
-
Push to Docker Hub
-
Authenticate to GCP
-
Update Kubernetes Deployment YAML
-
Deploy to GKE
π Jenkins Credentials Required
Make sure you have the following credentials set up in Jenkins:
sonar-token β SonarQube access token
docker-hub β Docker Hub username and password
How to Trigger the Pipeline
π― Outcome
Automatically builds your Java app
Runs SonarQube analysis for quality checks
Pushes production-ready Docker image to Docker Hub
Deploys the container on GKE via kubectl apply
π οΈ Improvements (Future Scope)
Add Quality Gate check stage for SonarQube
Add Slack notifications for success/failure
Use Helm instead of raw YAML for Kubernetes
Integrate Terraform fully for infra provisioning
Built with β€οΈ using Jenkins, Docker, and Kubernetes