如果项目质量门操作失败,如何在声呐5.1+上使用Build Breaker [英] How to use the Build Breaker on sonarqube 5.1+ if a project quality gate fails
问题描述
我正在使用Jenkins Continuous Integration
服务器和Sonarqube
进行代码覆盖.我想确保如果项目中的问题达到 Quality Gate 的阈值值,则项目构建应该会失败.我已经在Sonarqube
中安装了 Build Breaker 插件.我在某处读到它默认情况下适用于每个项目,并将构建失败的报告发送到CI服务器(在我的情况下为詹金斯).
I am using Jenkins Continuous Integration
server and Sonarqube
for code coverage. I want to make sure that if the issues in the project reach a threshold value of Quality Gate, the project build should fail. I have installed Build Breaker plugin in Sonarqube
. I read somewhere that it applies on each and every project by default and sends build failed report to CI server(Jenkins in my case).
但是这没有发生.即使问题已达到阈值,我的项目构建也能在CI服务器上成功完成.
But this is not happening. My project builds are successful on CI server even if the issues have reached threshold value.
我无法使用Build Breaker,因为它没有提供任何参数或用于配置它的东西.问题看起来像这样:
I am not able to use Build Breaker as it doesn't provides any parameters or something to configure it. The problem looks like this:
请帮助我进行配置,以便将失败的构建状态发送到CI服务器. 如果无法以任何方式进行,请让我知道是否存在任何通知机制,以至少通知开发人员有关已达到阈值的问题.
Please help me to configure this, so that I can send a failed build status to my CI server. If it is not possible in any way, then please let me know if there is any notification mechanism to at least notify developers about issues that have reached threshold.
推荐答案
Build Breaker在SonarQube 5.2中停止工作.现在,您有2种方法来实现Build Breaker功能:
The Build Breaker stopped working in SonarQube 5.2. You now have 2 ways to implement the Build Breaker functionality:
- 社区支持的插件
- api/qualitygates/project_status 网络服务(在5.3中开发).然后,您可以轻松创建自己的脚本来检查给定项目的质量门状态
- the community supported plugin
- the api/qualitygates/project_status web service (developed in 5.3). You can then easily create your own script to check the quality gate status of a given project
有关上下文,这里是为什么SonarSource认为该构建不应使用断路器
这篇关于如果项目质量门操作失败,如何在声呐5.1+上使用Build Breaker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!