This project demonstrates a complete CI/CD pipeline implementation using modern DevOps tools and practices. The pipeline follows the sequence:
Git ➜ Jenkins ➜ Maven ➜ SonarQube ➜ Docker ➜ Trivy ➜ Kubernetes ➜ Slack
The Jenkinsfile in this repository is currently experiencing compatibility issues. Please use the provided pipeline-script.txt for Jenkins pipeline configuration instead. The script version has been tested and works correctly with the current setup.
- Java 17
- Spring Boot 3.3.11
- Maven
- Jenkins
- SonarQube
- Docker
- Kubernetes
- Trivy (for security scanning)
java-maven-app/
├── src/ # Application source code
├── k8s/ # Kubernetes configurations
├── pom.xml # Maven configuration
├── Dockerfile # Container image definition
├── pipeline-script.txt # Working Jenkins pipeline script
├── Jenkinsfile # (Currently not working)
└── sonar-project.properties
# Build the application
mvn clean install
# Run locally
java -jar target/*.jar
docker build -t your-registry/java-maven-app:latest .
docker run -p 8081:8081 your-registry/java-maven-app:latest
- Create a new Pipeline job in Jenkins
- Copy contents from pipeline-script.txt
- Configure environment variables as needed
- Run the pipeline
kubectl apply -f k8s/
- Health Check: http://localhost:8081/hello
- Application runs on port 8081
- Kubernetes service exposes port 80
- SonarQube configuration in sonar-project.properties
- Trivy scanning for vulnerabilities
- Resource limits in Kubernetes
- Fixed dependency versions
- Kubernetes readiness probe
- Basic Spring Boot actuator endpoints
- SonarQube quality metrics
- Implement automated testing
- Add Prometheus metrics
- Configure horizontal pod autoscaling
Contributions are welcome. Please follow the standard fork and pull request workflow.