-
Notifications
You must be signed in to change notification settings - Fork 34
SonarQube Quality Gates Task Plugin
- Download gocd-sonarqube-qualitygates-plugin
- Copy it to Go.CD server plugin external folder (path to go-server/plugins/external)
- Restart go-server service.
A SonarQube scan has to be already configured for your project. You can use sonar-runner or maven, gradle, msbuild plugins provided by SonarQube for scanning your project. See analyzing source code in SonarQube documentation for details.
On your SonarQube server go to "Quality Gates" and add your project to a Quality Gate. You can use the predefined "SonarQube way" quality gate or you can define your own rules.
After configuring a quality gate for your project run a SonarQube scan on your project. After completion, you will see a quality gate result on the dashboard of your project. (see red box on the screen)
Select "SonarQube - Quality Gate" from add task drop down list.
Enter the project key of your SonarQube project in the task configuration. Your SonarQube project key is displayed at the bottom of your SonarQube project dashboard.
Select if the task will fail on a quality gate warning or error. If there is no quality gate defined for your project, the task will also fail and stop your pipeline. Save the task config and run your pipeline.