Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohamedzaahran/currency-exchange
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.
https://github.com/mohamedzaahran/currency-exchange
automation cicd devops docker jenkins kubernetes
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/mohamedzaahran/currency-exchange
- Owner: MohamedZaahran
- Created: 2024-08-10T19:39:49.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-12T18:39:16.000Z (5 months ago)
- Last Synced: 2024-09-30T17:42:56.614Z (3 months ago)
- Topics: automation, cicd, devops, docker, jenkins, kubernetes
- Language: Java
- Homepage:
- Size: 972 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Automated CI/CD Pipeline with Docker, Jenkins, and Kubernetes
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.![Workflow](https://github.com/user-attachments/assets/6b3e9b6b-dd67-42c7-a7c5-311f9e4e774a)
## Key Features:
### Jenkins Pipeline Automation:
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.![Jenkins Pipeline](https://github.com/user-attachments/assets/158ecb3d-e967-48d5-a0fc-71255c5d7eb6)
### Docker Integration:
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**.### Docker Image Scanning with Trivy:
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.### SonarQube Code Analysis:
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.![SonarQube Analysis](https://github.com/user-attachments/assets/8ac324be-9098-4f00-a815-75bd84c1e806)
### Kubernetes Deployment:
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.### Environment Setup and Verification:
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.## How It Works:
1. **SCM Polling:** Jenkins polls the SCM repository for changes every minute.
2. **Environment Setup:** Jenkins verifies that the required tools (Maven, Docker) are installed.
3. **Build & Test:** The application is built, tested, and packaged using Maven.
4. **SonarQube Analysis:** The source code is analyzed for quality and security issues using SonarQube.
5. **Docker Image Creation:** The packaged application is built into a Docker image, tagged, and pushed to Docker Hub.
6. **Trivy Docker Image Scanning:** The Docker image is scanned for vulnerabilities using Trivy.
7. **Kubernetes Deployment:** The Docker image is deployed to a Kubernetes cluster using Minikube.
8. **Deployment Verification:** The pipeline verifies that the application is successfully deployed and running in the Kubernetes cluster.
This setup ensures a robust and automated process for continuous integration and deployment, reducing manual intervention and minimizing the risk of errors in the deployment process.## Technologies Used:
- **Jenkins:** For automating the CI/CD pipeline.
- **Docker:** For containerizing the application.
- **Kubernetes:** For orchestrating the deployment and management of the containerized application.
- **Maven:** For building, testing, and packaging the Java application.
- **SonarQube:** For static code analysis to ensure code quality.
- **Trivy:** For scanning Docker images for vulnerabilities.