Jenkins CI/CD — SonarQube Jenkins Integration
In this article, we can discuss about the integration of SonarQube with the Jenkins.
Pre-requisites:
Jenkins and SonarQube Server is installed and the server is up and running
- Step 1: Install the SonarQube Scanner for Jenkins in Jenkins
Manage Jenkins → Manage Plugins → Click on the Available tab and search for the ‘SonarQube Scanner for Jenkins’ → Click on ‘Download now and install after restart’
Step 2 : Go to SonarQube Home Page, Click on Administration → Under Security drop down click on Users
Step 3: In the administrator user, Click on the Token Section ( marked below)
After clicking, a window will pop up like the below.
Enter the Token name as Jenkins-Sonar ( It can be any logical name ) and click on the Generate Button. Copy the token in the notepad and click on the done button
Step 4: Go to Jenkins Home Page, Click on the Credentials and add the generated token from the SonarQube.
Step 5: Go to Jenkins Home Page, Click on Manage Jenkins → Configure System → Search for the SonarQube Section.
- Fill the Name: sonar( It can be any logical name )
- Place your sonar URL in the Server URL: http://102.156.32.56:9000/
- In Server authentication token, select the recently added secret text of the generated token from the SonarQube ( Step 4 ) and click on the save button.