Skip to content

Example to run sonar analyzer

Michael Mairegger edited this page Sep 9, 2015 · 1 revision

Preparation

To create a project on SonarQube open the Provisioning page SonarQube and create a new project with the realtimebus key and master branch.

Sample configuration files

Create following two files:

Save following file under config/realtimebus.json

{
  "GitHubRepository": "realtimebus",
  "GitHubRepositoryOwner": "tis-innovation-park",
  "RescanFrequency": "00:05:00",
  "AnalysationBehavior": "Tags"
}

Save following file under config/realtimebus.properties

sonar.projectKey= realtimebus:master
sonar.projectName=realtimebus

Run sonar-analyzer

To run provide following arguments

sonar-analyzer.exe --analyze --fetch --token=GITHUBTOKEN --config="path-to-realtimebus.json"

or

sonar-analyzer.exe --analyze --fetch --token=GITHUBTOKEN

By using the second command you have to ensure that realtimebus.json and realtimebus.properties is located in the config subdirectory. The subdirectory must be on the same level as sonar-analyzer.exe.

Clone this wiki locally