Overview
SonarQube Server supports integration on multiple platforms allowing you to maintain code quality and security in your projects.
Pull request analysis is available as part of Developer Edition and above.
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. The operation depends on the CI tool used.
With Jenkins, you can suspend pipeline execution until the analysis’ quality gate status is known. See the Setting up a pipeline pause integration page.
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.
You can configure the SonarScanner to wait for the quality gate result. This setting will force the pipeline to fail if the quality gate fails.
To do so:
Set the
sonar.qualitygate.waitanalysis parameter totrue.You can set the
sonar.qualitygate.timeoutanalysis parameters to the number of seconds that the scanner should wait for a report to be processed. The default is 300 seconds.
For general information about setting up analysis parameters at the global and project levels, see Analysis parameters and the respective SonarScanner section: SonarScanner for Maven, SonarScanner for Gradle, Configuring the scanner, Configuring the scanner, or SonarScanner CLI.
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 section.
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?

