How to use the Build Breaker on sonarqube 5.1+ if a project quality gate fails

风流意气都作罢 提交于 2019-12-09 18:36:09

问题


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).

But this is not happening. My project builds are successful on CI server even if the issues have reached threshold value.

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:

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.


回答1:


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

For a bit of context, here's why SonarSource thinks the Build Breaker shouldn't be used




回答2:


I see you are using sonarqube 5.1 and Jenkins. Pre-commit build breaking with build breaker stopped working in sonarqube 5.1. (See: http://sonarqube-archive.15.x6.nabble.com/Sonarqube-and-Build-Breaker-Plugin-td5034703.html)

I think this has been resolved as of 5.4 but am unsure.

Mike



来源:https://stackoverflow.com/questions/36885064/how-to-use-the-build-breaker-on-sonarqube-5-1-if-a-project-quality-gate-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!