Overview

SonarQube Community Build supports integration on multiple platforms allowing you to maintain code quality and security in your projects.

Failing a pipeline job when the quality gate fails

You can ensure your code meets your quality standards by failing your pipeline job when your quality gate fails.

With Jenkins, you can suspend pipeline execution until the analysis’ quality gate status is known. See the Key features integration pages.

With GitHub Actions, you can fail the pipeline job when the quality gate fails using the SonarQube Quality Gate Check Action.

With Bitbucket Pipelines, you can fail the pipeline job when the quality gate fails using the SonarQube Quality Gate Check Pipe.

For other CIs, you can use the sonar.qualitygate.wait=true analysis parameter in your configuration file. Setting sonar.qualitygate.wait to true forces the analysis step to poll your SonarQube Community Build instance until the quality gate status is available. This increases the pipeline duration and causes the analysis step to fail any time the quality gate fails, even if the actual analysis is successful. You should only use this parameter if it’s necessary.

You can set the sonar.qualitygate.timeout property to the number of seconds that the scanner should wait for a report to be processed. The default is 300 seconds.

GitLab CI/CD

For GitLab CI/CD configuration, see the Adding analysis to GitLab CI/CD pipeline page.

GitHub Actions

For GitHub Actions configuration, see the Adding analysis to GitHub Actions workflow page.

Azure Pipelines

For Azure Pipelines configuration, see the Adding analysis to Azure pipeline page.

Bitbucket Pipelines

For Bitbucket Pipelines configuration, see the Analyzing projects with Bitbucket Pipelines page.

Jenkins

For Jenkins configuration, see Adding analysis to a Jenkins job.

Last updated

Was this helpful?