[英]How to check the quality gate of a SonarQube analysis into a job
I'm working on a jenkins job without the possibility of using a pipeline.我正在从事詹金斯的工作,但不可能使用管道。
What i need to do is to launch some sonarQube Analysis and to check if the quality gates has passed.我需要做的是启动一些 sonarQube 分析并检查质量门是否已经通过。 If the analysis with the quality gate fails, i would like to block my job.
如果质量门的分析失败,我想阻止我的工作。
I know that i can do this by scripting a pipeline and i know how to do it, but in this particular case i cannot write a pipeline but i can use only the "Prebuild steps" and "After Build Steps" of the job.我知道我可以通过编写管道脚本来做到这一点,我知道如何做到这一点,但在这种特殊情况下,我无法编写管道,但我只能使用作业的“预构建步骤”和“构建后步骤”。 So my questions are:
所以我的问题是:
Thanks everybody!谢谢大家!
In this case probably the easiest thing would be to instruct sonar-scanner to wait for quality gate result.在这种情况下,最简单的方法可能是指示声纳扫描仪等待质量门结果。 From the documentation :
从文档:
you can use the
sonar.qualitygate.wait=true
analysis parameter in your configuration file.您可以在配置文件中使用
sonar.qualitygate.wait=true
分析参数。 Settingsonar.qualitygate.wait
to true forces the analysis step to poll your SonarQube instance until the Quality Gate status is available.将
sonar.qualitygate.wait
设置为 true 会强制分析步骤轮询您的 SonarQube 实例,直到 Quality Gate 状态可用。 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.这会增加管道持续时间并导致分析步骤在质量门失败时失败,即使实际分析成功也是如此。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.