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

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

问题描述

我正在使用 Jenkins 持续集成 服务器和 Sonarqube 进行代码覆盖.我想确保如果项目中的问题达到 Quality Gatethreshold 值,则项目构建应该会失败.我在 Sonarqube 中安装了 Build Breaker 插件.我在某处读到它默认适用于每个项目,并将构建失败报告发送到 CI 服务器(在我的例子中是 Jenkins).

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.

推荐答案

在 SonarQube 5.2 中 Build Breaker 停止工作.您现在有 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 认为 Build不应使用断路器

这篇关于如果项目质量门失败,如何在 sonarqube 5.1+ 上使用 Build Breaker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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