Setting up Jenkins
This page explains how to set up Jenkins globally for the integration with SonarQube Community Build by using SonarQube extension for Jenkins.
This section explains how to set up Jenkins globally for the integration with SonarQube Community Build by using Jenkins extension. This extension is not mandatory but allows a centralized installation and setup of the scanner directly from Jenkins.
Proceed as follows:
Install the Jenkins extension.
Install the SonarScanner from Jenkins.
These steps are explained below.
Installing the Jenkins extension
Jenkins extension version 2.11 or later is required.
Proceed as follows:
From the Jenkins Dashboard, navigate to Manage Jenkins > Manage Plugins and install the SonarQube Scanner plugin.
Back at the Jenkins Dashboard, navigate to Credentials > System from the left navigation.
Click the Global credentials (unrestricted) link in the System table.
Click Add credentials in the left navigation and add the following information:
Kind: Secret Text
Scope: Global
Secret: Generate a token at User > My Account > Security in SonarQube Community Build, and copy and paste it here.
Click OK.
From the Jenkins Dashboard, navigate to Manage Jenkins > Configure System.
From the SonarQube section, click Add SonarQube. Add the following information:
Name: Give a unique name to your SonarQube Community Build instance.
Server URL: Your SonarQube Community Build instance URL.
Credentials: Select the credentials created during step 4.
Click Save
Installing the SonarScanner instance(s)
From Jenkins, install and configure the SonarScanner instance(s). This step depends on the project type.
Log into Jenkins as an administrator and go to Manage Jenkins > Configure System.
Scroll to the SonarQube servers section and check Enable injection of SonarQube server configuration as build environment variables.
Other settings
If applicable, configure Webhooks at global level to be used for pipeline jobs to set up a pipeline pause. See Setting up a pipeline pause fore more information.
Related pages
Last updated
Was this helpful?