This repository contains scripts and configurations to set up a Continuous Integration (CI) pipeline using Jenkins and AWS EC2 instances. The pipeline fetches a sample project from GitHub, builds it using Maven, runs tests, performs code analysis with SonarQube, and uploads artifacts to NexusOSS.
- AWS account with permissions to create EC2 instances.
- Basic understanding of Jenkins, Maven, SonarQube, and NexusOSS.
- Launch an EC2 instance with Jenkins installed. Follow the official Jenkins documentation for installation steps.
- Install necessary plugins: Nexus Artifact Uploader, SonarQube Scanner, Pipeline Maven Integration, etc.
- Launch an Ubuntu EC2 instance.
- Install SonarQube, Nginx, and PostgreSQL according to the setup instructions.
- Launch a CentOS EC2 instance.
- Install NexusOSS following the installation guide.
-
Configure Jenkins:
- Install Jenkins plugins required for the pipeline.
- Set up Jenkins credentials for GitHub, NexusOSS, and SonarQube.
-
Create a Jenkins Pipeline:
- Copy the Jenkinsfile from this repository into your Jenkins pipeline configuration.
- Update the pipeline script as needed based on your environment settings.
-
Fetch Code:
- Jenkins pipeline will fetch code from the GitHub repository.
-
Build:
- Maven will build the project, skipping tests during this phase.
-
Test:
- Maven will run unit tests on the project.
-
Checkstyle Analysis:
- Maven will perform Checkstyle analysis on the code.
-
Sonar Analysis:
- SonarQube will analyze the code for quality metrics using the configured SonarQube server.
-
Quality Gate:
- Jenkins will wait for the Quality Gate status from SonarQube.
-
Upload Artifact:
- The pipeline will upload the built artifact (WAR file) to NexusOSS for artifact management.
Contributions are welcome! If you have suggestions or improvements, please fork the repository and create a pull request.
This project was developed as part of a DevOps course on Udemy, where I learned the foundational skills for setting up CI/CD pipelines.






