Must-share information (formatted with Markdown):
- sonar-scanner 5.0.1
What do I want to achieve:
I want to have different scenarios depending on the sonar-scanner execution, if I use the property sonar.qualitygate.wait
. Which exit codes will be used when the scanner fails?
From the doc:
For other CIs, you can use the
sonar.qualitygate.wait=true
analysis parameter in your configuration file. Settingsonar.qualitygate.wait
to true forces the analysis step to poll your SonarQube 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.
How can I detect if the sonar-scanner failed because of the quality gate or the execution? Is there a specific exit code to check? Something like quality gate failed is exit code 2?