This project demonstrates a continuous integration and continuous delivery (CI/CD) pipeline using Jenkins, SonarQube, and Docker.
- Docker installed and running
- Jenkins installed and accessible
- SonarQube installed and accessible
- Git client installed
- A GitHub repository containing your project code
.
├── Dockerfile
├── docker-compose.yml
├── Jenkinsfile
├── README.md
├── src
│ └── ... (your project code)
└── ... (other project files)
- Code Commit: Changes are committed to the GitHub repository.
- GitHub Webhook: A webhook triggers the Jenkins pipeline.
- Jenkins Job: The Jenkins job starts:
- Checkout: Downloads the code from the GitHub repository.
- Build: Builds the project using Docker.
- SonarQube Analysis: Runs SonarQube analysis on the built project.
- Push Docker Image: Pushes the built Docker image to a Docker registry.
- Deploy: Deploys the Docker image to your desired environment.
- Dockerfile: Define how to build the Docker image.
- docker-compose.yml: Define services for running Jenkins and SonarQube.
- Jenkinsfile: Define the pipeline steps in Jenkins.
- SonarQube: Configure SonarQube to analyze your project code.
- Build the Docker image:
docker-compose build
- Start the services:
docker-compose up -d
- Commit changes to your GitHub repository.
- The pipeline should automatically start and run through the defined steps.
- Jenkins: Monitor the pipeline progress and check job logs in the Jenkins web interface.
- SonarQube: View code quality reports and dashboards in the SonarQube web interface.
- You can customize the pipeline further by adding additional steps, such as unit tests or security scans.
- You can integrate other tools and services into the pipeline to automate your CI/CD workflow.
- Jenkins Documentation: https://www.jenkins.io/doc/
- SonarQube Documentation: https://docs.sonarsource.com/sonarqube/latest/
- Docker Documentation: https://docs.docker.com/
This project is licensed under the MIT License. See the LICENSE file for details.