This project involved setting up a continuous integration and continuous deployment (CI/CD) pipeline to automate the process of building, testing, and deploying a website using Jenkins, GitHub, SonarQube, Docker, and Amazon Web Services (AWS).
The architecture consists of the following components:
- 3 AWS EC2 Instances hosting:
- Jenkins server
- SonarQube server
- Docker server
- GitHub - Holds source code for the website
- SonarQube - Code quality and test coverage analysis
- Docker - Containerization of the website application
- Jenkins - Orchestrates the CI/CD pipeline
- Launched 3 EC2 instances to host Jenkins, SonarQube and Docker server
- Assigned Elastic IPs to make them publically accessible
- Opened required ports in Security Groups for access
- Installed and configured Jenkins, SonarQube and Docker on respective servers
- Created a GitHub repository to manage source code for the website
- Added code, tests, configs etc. for the website application
- Integrated the repo with Jenkins
- Installed necessary plugins on Jenkins server
- Created a Jenkins pipeline job
- Setup webhook in GitHub repo to trigger pipeline on commits
- Configured stages including Clone Repo, Build Artifact, SonarQube Analysis, Build Docker Image, and Deploy
- Installed and configured SonarScanner on Jenkins server
- Passed SonarQube server credentials and details as environment variables
- Added a stage to run SonarQube analysis against source code
- Published quality gate check results back to Jenkins
- Created a Dockerfile to package website code
- Added pipeline stage to build Docker image of the website
- Pushed image to Docker Hub registry
- Pull website Docker image in the deployment stage
- Deploy container with Nginx to render the website
- Health check added to validate deployment
The Jenkins pipeline automates continuous analysis, testing and deployment of the website application in a standardized and efficient software delivery process. This results in faster feedback on changes and more reliable updates to production.
Let me know if you need any clarification or have additional questions!