Jenkins CI/CD Pipeline Setup

Jenkins CI/CD Pipeline Setup

Jenkins CI/CD Pipeline with GitHub + Maven + Nexus + SonarQube + Tomcat

Here we will complete our setup in 6 steps

Step - 1. Environment Setup

1.1)?In AWS Portal create a new instance as,

Name??: Jenkins-server

AMI?????: Ubuntu

Instance type??: t2.micro?(free tier)

Key pair : create

Allow: HTTP & HTTPS

Allow: port number : 8080 (Jenkins default port number)

Allow : SSH 22

1.2)?Connect to Ubuntu VM using MobaXterm

No alt text provided for this image

1.3)?Now install Jenkins on the machine, by following this link

https://www.jenkins.io/doc/book/installing/linux/#debianubuntu

No alt text provided for this image

1.4)?Now copy the public IP of the machine and paste it to the browser to access the Jenkins Portal.

VM Public IP : 8080

Ex: 11.22.33.44:8080

No alt text provided for this image

1.5)?Now click on, “install suggested plugins”

No alt text provided for this image

1.6)?This will install all suggested plugins

No alt text provided for this image

1.7)?Now the Jenkins is ready to use

No alt text provided for this image

1.8)?Jenkins home page

No alt text provided for this image

1.9)??Create a CI/CD Pipeline,

From Jenkins Dashboard click on “New Item”

No alt text provided for this image

1.10)?Create a pipeline for project

Enter an item name --> choose project name

Click on pipeline option --> ok

No alt text provided for this image

Step - 2. Source Code Clone from GitHub

2.1)?Select pipeline syntax?

No alt text provided for this image

2.2)?Select GitHub Repository URL ?and add credentials?

No alt text provided for this image

2.3)??Add GitHub pipeline syntax same like below

No alt text provided for this image

2.4)?Git Clone completed successfully

No alt text provided for this image

Step - 3) Maven Build

3.1)?Add Maven in Global Tool Configuration

No alt text provided for this image

3.2)?Select Maven name & Maven version

No alt text provided for this image

3.3)?Write pipeline syntax to build java project?

No alt text provided for this image

3.4)?Maven build Success and target folder created

No alt text provided for this image

Step - 4) SonarQube Scanner

4.1)?In AWS Portal, create a new instance as,

Name??: Sonar-Server

AMI?????: Amazon Linux

Instance type??: t2.micro (free tier)

Key pair: create

Allow: port number: 9000 (SonarQube default port number)

4.2)?Install SonarQube software and check sonar running

No alt text provided for this image

4.3)?Now copy the public IP of sonar-server machine and paste it to the browser to access the sonar server

Sonar-server public IP: 9000

No alt text provided for this image

4.4)?SonarQube Login page

No alt text provided for this image

4.5)?Create new project

No alt text provided for this image
No alt text provided for this image

4.6)?Download SonarQube Scanner plug in

No alt text provided for this image
No alt text provided for this image

4.7)?Configure Sonar in global tool configuration

No alt text provided for this image

4.8)?Configure Sonar in configure system

No alt text provided for this image

4.9)?Configure Sonar syntax like below

No alt text provided for this image

4.10)?SonarQube build success

No alt text provided for this image

4.11)?SonarQube project uploaded to Sonar portal

No alt text provided for this image

Step - 5) Nexus Artifactory

5.1)?In AWS Portal, create a new instance as,

Name??: Nexus

AMI?????: Amazon Linux

Instance type??: t2.micro (free tier)

Key pair: create

Allow: port number: 8081 (Nexus default port number)

5.2)?Connect ec2 machine using MobaXterm

5.3)?Download nexus software?

https://help.sonatype.com/repomanager3/product-information/download

5.4)?Login to Nexus

No alt text provided for this image

5.5)?Create Repository to store Artifacts

No alt text provided for this image

5.6)?Download nexus Plugin from Manage Jenkins

No alt text provided for this image

5.7)?Select pipeline syntax option

No alt text provided for this image

Sample step --> nexus artifact uploder:nexus artifact uploader

Nexus version select --> S3

Protocol --> HTTP

Nexus URL --> ex: 11.22.123.456:8081

Credentials -> nexus credentials

Group id--> in.mounika

Version -->1.0-SNAPSHOT

Repository --> Repository name

Artifact id --> artifact name (ex: 01-maven-web-app)

Type --> war

File --> target/01-maven-web-app.war (war file location)

Copy pipeline syntax and paste in script?

5.8)?Nexus Pipeline Syntax

No alt text provided for this image

5.9)?Artifacts uploaded to Nexus Portal

No alt text provided for this image

Step - 6) Tomcat Deploy

6.1)?In AWS Portal, create a new instance as,

Name??: Tomcat-Server

AMI?????: Amazon Linux

Instance type??: t2.micro (free tier)

Key pair: create

Allow: port number: 8080 (Nexus default port number)

6.2)?Connect ec2 machine using MobaXterm

6.3)?Download tomcat server?

https://tomcat.apache.org/download-90.cgi

6.4)?Login into Tomcat server

No alt text provided for this image

6.5)?Tomcat plugin installation go to Jenkins page???

No alt text provided for this image

6.6)?Tomcat syntax

No alt text provided for this image

6.7)?Tomcat build success

No alt text provided for this image

6.8)?Successfully Project deployed to tomcat server

Click on project name

No alt text provided for this image


No alt text provided for this image

Happy Learning! :)

Thank you for Reading. I hope you found this article helpful.

~ Mounika Jilakari.

Muhammad Abrar Alam

Lead Engineer - DevOps at Avrioc Technologies

1 年

??

要查看或添加评论,请登录

mouni ka的更多文章

  • GitHub Actions Scouting Myntra App | DevSecOps

    GitHub Actions Scouting Myntra App | DevSecOps

    STEP 1A: Setting up AWS EC2 Instance and IAM Role Sign in to the AWS Management Console Access the AWS Management…

  • Setup ELK Stack Architecture

    Setup ELK Stack Architecture

    Continuous Monitoring: Continuous Monitoring is an important part of software development. It measures the health of…

  • Port Numbers

    Port Numbers

    DevOps engineers often work with a variety of tools and services that communicate over specific port numbers. ????????…

    1 条评论
  • Terraform: Deploying a 2-Tier Architecture

    Terraform: Deploying a 2-Tier Architecture

    Scenario Deploying a 2-tier architecture that includes all our code in a single main.tf file (known as a monolith) with…

  • Lost your Amazon EC2 Keypair?

    Lost your Amazon EC2 Keypair?

    In this, we have created two instances (DB-Server and Helper-EC2), of which one has lost its keypair. We lost our…

  • In this project I’m doing how to deploy a WordPress website on AWS(EC2 Ubuntu Instance) using Docker.

    In this project I’m doing how to deploy a WordPress website on AWS(EC2 Ubuntu Instance) using Docker.

    WordPress is a popular web hosting site that is very easy to use and setup. The platform allows users to create and…

  • Jenkins Pipeline (Docker + Kubernetes)

    Jenkins Pipeline (Docker + Kubernetes)

    Step - 1: Jenkins Server Setup 1.1) Create Ubuntu VM (20.

  • Hosting Static Website With AWS S3

    Hosting Static Website With AWS S3

    Hosting Static Website With AWS S3 Steps to develop Static website 1) login to AWS Portal 2) Search for S3 Service 3)…

    2 条评论
  • DevOps Project Setup

    DevOps Project Setup

    Spring Boot + Angular + Docker + Kubernetes – Project Setup In this project I have deployed one Full Stack Application…

社区洞察

其他会员也浏览了