如何在jenkins服务器中发布声纳结果,或者我们是否有声纳报告jenkins插件 [英] how to publish sonar result in jenkins server, or do we have sonar-report jenkins plugin
问题描述
有一个用于詹金斯的声纳插件,它会触发内部的声纳构建CI(詹金斯),很有用.
There is a sonar plugin for jenkins, it triggers the sonar build inside CI (jenkins), it is useful.
虽然我现在想在jenkins中查看声纳结果而无需跳转到声纳网站,但是如果我只想查看此工作的一些关键数据,这将非常有用.
While now I want to see the sonar result inside jenkins without jumping to sonar websites, it is useful if I just want to see some key data for this job.
它可能是jenkins中的声纳报告插件.
It could be sonar-report plugin in jenkins.
您有类似的需求吗?
推荐答案
到目前为止,我使用的一个难看的解决方案是使用声纳Web API.
One ugly solution I used so far is to use Sonar Web API.
我在工作结束时添加一个curl
命令(构建步骤)以获取所需的指标,例如
I add one curl
command in the end of job (build steps) to fetch the needed metrics like
curl http://sonar.sh.cn.ao.ericsson.se//api/resources?metrics=qi-quality-index,coverage,test_success_density&resource=54936 --output sonar-result.xml
然后我将sonar-result.xml
存档以使其在作业中可见.
Then I archive the sonar-result.xml
to make it visible inside the job.
这篇关于如何在jenkins服务器中发布声纳结果,或者我们是否有声纳报告jenkins插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!