Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change: Quality Gate from Jenkins (sonar-runner)

I am using Jenkins to kick off Sonar-runner for analyzing projects.

Now I use the Build Breaker plugin. This breaks a build when a quality gate is reporting that the quality is below/above given values.

I'd like to change the quality gate used by the Sonar-Runner, on a per-job basis in Jenkins. Looking up at Analysis Parameters documentation:

**sonar.profile** parameter is to change the language to analyse

I would thought that for the gate: sonar.gate would work (it doesn't)


Question:

What parameter for sonar-runner has to be used to change the "Quality Gate"?

Used versions:

  • Jenkins 1.598
  • Sonar 4.5.1 (LTS)
like image 625
TheMiXeD Avatar asked Feb 03 '15 08:02

TheMiXeD


1 Answers

The property is sonar.qualitygate.

It was not documented because this is generally not a good idea to change the quality gate that should be used during a standard analysis - but it's true that it can be useful with the build breaker on preview analyses.

I updated the documentation.

like image 67
Fabrice - SonarSource Team Avatar answered Sep 24 '22 04:09

Fabrice - SonarSource Team