如果项目质量门操作失败,如何在声呐5.1+上使用Build Breaker [英] How to use the Build Breaker on sonarqube 5.1+ if a project quality gate fails

查看:619
本文介绍了如果项目质量门操作失败,如何在声呐5.1+上使用Build Breaker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆