Skip to content

sajalmishra786/Jenkins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CI/CD Pipeline with Jenkins and AWS

Overview

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.

Setup Instructions

Prerequisites

  • AWS account with permissions to create EC2 instances.
  • Basic understanding of Jenkins, Maven, SonarQube, and NexusOSS.

EC2 Instances Setup

Jenkins Instance:

  • 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.

SonarQube Instance:

  • Launch an Ubuntu EC2 instance.
  • Install SonarQube, Nginx, and PostgreSQL according to the setup instructions.

Nexus Instance:

  • Launch a CentOS EC2 instance.
  • Install NexusOSS following the installation guide.

Jenkins Setup

  1. Configure Jenkins:

    • Install Jenkins plugins required for the pipeline.
    • Set up Jenkins credentials for GitHub, NexusOSS, and SonarQube.
  2. 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.

Running the Pipeline

  • 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.

Screenshots

Screenshot 3 Screenshot 4 Screenshot 6 Screenshot 7 Screenshot 1 Screenshot 2 Screenshot 5

Contributing

Contributions are welcome! If you have suggestions or improvements, please fork the repository and create a pull request.

Credits

This project was developed as part of a DevOps course on Udemy, where I learned the foundational skills for setting up CI/CD pipelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors