Skip to content

lerndevops/cicd-Jenkins-Docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Continuous Integration & delivery using Jenkins, maven, Sonarqube and Docker

#Run jenkinsserver.sh on a ubuntu vm with 2gb ram, 2 cpus or more

#Run sonarserver.sh on on a ubuntu vm with 2.5gb ram, 2 cpus or more

Install Jenkins Plugin : Build Timestamp Plugin , CloudBees Docker Build and Publish plugin , Docker Pipeline, Docker plugin, Pipeline Maven Integration Plugin, Pipeline Utility Steps, SonarQube Scanner for Jenkins, Slack Notification Plugin

In global tool configuration add jdk8. Install openjdk-8-jdk on Jenkins vm and provide it's path as show in the picture :

JDK-GlobalToolConfiguration

In global tool configuration add Maven 3.3.9 :

Maven-Global-Tool-Configuration

Add SonarQube scanner in global tool configuration:

Sonar_scanner-GlobalToolConfiguration

For slack notification create an account on slack. Create a workspace, create a channel(ex #jenkins-cicd). In order for the Jenkins to authenticate to workspace, we need to create a token in Slack. For that, we need to add an app in Slack account. Search for the Slack apps or add apps to Slack :

addAppSlack

Add this app to slack. Choose a channel where you want to receive notification (ex. #jenkins-cicd). Add Jenkins Ci integration.

addAppSlack2

In set up instruction steps go to step3, copy the token then save the settings. Now go to manage jenkins --> configure system , search for Slack :

addAppSlack3

provide workspace name, credential( token copied earlier) , channel name then save it.

These 3 credentials required for this project :

Global-credentials

For sonarqube token first login to sonar server , username: admin, password: admin. Click on my aacount

image

In security give a name and generate token :

image

copy the token generated and use it to configure sonarqube server

image

In configure system add your Sonarqube server :

SonarQubeServer-ConfigureSystem

Create a job of type pipeline :

Jenkins-pipeline-config

Click Build now to run the job :

Jenkins-pipeline

After competion of job we will receive a slack notification ( green colour for success & red colour for failure ) :

Slack-Notification image

Docker image will be build and uploaded to docker hub account:

Docker-Hub

This latest tag image will be used in our continuous deployment with Argocd on kubernetes cluster project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 79.8%
  • CSS 17.6%
  • Shell 2.5%
  • Dockerfile 0.1%