Jenkins can be used as an intermediary between SonarQube™ and your Git repository.
-
First, you need to have a version of Jenkins and a working SonarQube™ server. If you do not, you can download the CodeScan Bundler from the downloads page. This comes complete with Jenkins and SonarQube™ as a ready to go package. For more information and notes on installing the CodeScan Bundler, click here.
-
Open Jenkins in your browser. The latest CodeScan Bundler comes with a template project called CodeScan Template - Git Download. Click New Item on the Jenkins Dashboard, give your new item a name and fill in the text field to “Copy from” the CodeScan Template - Git Download project.
-
In the Configuration for your new item, you can set the
sonar.projectName
variable. This is how the project will show up in SonarQube™. -
The
salesforce.username
andsalesforce.password
variables are optional but need to be set if you want to view your code coverage. -
Next, scroll down to Source Code Management and enter your repository URL. If the repository requires credentials (either username and password or SSH username and private key), you can add them here also.
-
Save these settings (bottom left of the browser). Your new project is ready to go.
-
Click Build with Parameters to start the scan. You can track its progress by clicking on the current build and selecting Console Output.
-
Any problems? Try visiting our Troubleshooting Page