First, you need SonarQube server 6.2+. In your Jenkins instance, install the latest version of the SonarQube Scanner for Jenkins (2.6.1+). You should, of course, configure in Jenkins administration section the credentials to connect to the SonarQube server.

In your SonarQube server administration page, add a webhook entry:

Now you can configure a pipeline job using the two SonarQube keywords ‘withSonarQubeEnv’ and ‘waitForQualityGate’.

The first one should wrap the execution of the scanner (that will occupy an executor) and the second one will ‘pause’ the pipeline in a very light way, waiting for the webhook payload.

Here you are:

That’s all Folks!

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Want to Get in Touch?

Spelling error report

The following text will be sent to our editors: