#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 :
In global tool configuration add Maven 3.3.9 :
Add SonarQube scanner in global tool configuration:
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 :
Add this app to slack. Choose a channel where you want to receive notification (ex. #jenkins-cicd). Add Jenkins Ci integration.
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 :
provide workspace name, credential( token copied earlier) , channel name then save it.
These 3 credentials required for this project :
For sonarqube token first login to sonar server , username: admin, password: admin. Click on my aacount
In security give a name and generate token :
copy the token generated and use it to configure sonarqube server
In configure system add your Sonarqube server :
Create a job of type pipeline :
Click Build now to run the job :
After competion of job we will receive a slack notification ( green colour for success & red colour for failure ) :
Docker image will be build and uploaded to docker hub account:
This latest tag image will be used in our continuous deployment with Argocd on kubernetes cluster project