This repository contains a fully automated Continuous Integration/Continuous Deployment (CI/CD) pipeline designed to streamline the development, testing, and deployment process of a Java-based microservice. The pipeline is built using Jenkins, Docker, and Kubernetes, enabling seamless integration and deployment from code commit to production.
This repository contains a fully automated Continuous Integration/Continuous Deployment (CI/CD) pipeline designed to streamline the development, testing, and deployment process of a Java-based microservice. The pipeline is built using Jenkins, Docker, and Kubernetes, enabling seamless integration and deployment from code commit to production.
The Jenkins pipeline is triggered by SCM polling, ensuring that the pipeline runs every time there's a new commit in the source code repository. Automated stages for building, testing, packaging, and deploying the application using Jenkins, providing clear feedback at every step of the process.
The application is packaged as a Docker image, ensuring consistent environments across development, testing, and production. The pipeline builds the Docker image using Maven, tags it with the build number, and pushes it to Docker Hub.
To ensure the security of the Docker images, the pipeline uses Trivy to scan the built Docker image for vulnerabilities. Trivy scans the image and reports any vulnerabilities, especially those with HIGH or CRITICAL severity, before pushing the image to Docker Hub.
The pipeline integrates SonarQube for static code analysis, ensuring that the code meets quality standards before being deployed. SonarQube analyzes the code, identifies potential bugs, code smells, and security vulnerabilities, and reports them within the pipeline.
The Docker image is deployed to a Kubernetes cluster running on Minikube, using a Kubernetes Deployment and Service definition. The pipeline includes a verification stage to ensure that the application is successfully deployed and running in the Kubernetes cluster.
Initial stages in the pipeline verify the environment setup, including Maven and Docker versions, ensuring that the necessary tools are in place before proceeding with the build. The pipeline automatically starts Minikube if it's not already running.