在VSTS/TFS构建摘要中显示HTML内容,而无需使用清单文件中的内容 [英] Display HTML content in VSTS/TFS build summary without using contribution in manifest file

查看:63
本文介绍了在VSTS/TFS构建摘要中显示HTML内容,而无需使用清单文件中的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了VSTS扩展,并且需要在我的VSTS/TFS摘要页面中显示图形内容(HTML页面),而不使用清单文件中的内容.导致我拒绝此选项的原因(例如,ms.vss-build-web.build-results-section)是因为在安装扩展程序后,即使它不包括在当前的构建任务列表中,贡献中定义的摘要部分开始出现在构建摘要中.这会导致不良的用户体验.

I have developed VSTS extension and I need to display graphical content (HTML page) in my VSTS/TFS summary page without using contribution in manifest file. Reason that led me to reject this option (e.g. ms.vss-build-web.build-results-section) is that when we are installed our extension, even if it is not included in current build task list, summary section defined in contribution started to appear in build summary.And this cause bad user experience.

我观察到某些扩展程序(例如声纳立方体)正在使用不同的机制在摘要选项卡中显示数据(

I observed that some extensions such as sonar cube are using different mechanism to display data in summary tab (https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube). However I couldn't figure out the way this achieved.

如果您可以提供提示以在构建结果页面中动态附加摘要信息,那将是非常有用的帮助.如果您可以提供示例,将会很有帮助.

It would be great help if you can provide tips to append summary information dynamically in the build result page. It will be much helpful if you can provide a sample.

此问题与我在以下问题中提出的问题有关:

This question is related to question I asked in : Hide VSTS/TFS extension's Summary section when extension not added to build task

推荐答案

只需在构建任务中调用##vso[task.uploadsummary]local file path.

Just call ##vso[task.uploadsummary]local file path in your build task.

例如:

Write-Host "##vso[task.addattachment type=Distributedtask.Core.Summary;name=SonarQube Analysis Report;]$reportPath"

更多信息,请参考记录命令.

顺便说一句,关于扩展程序的源代码,您可以下载扩展程序并将文件名后缀更改为XXX.zip,然后解压缩该文件.

BTW, about the source code of the extension, you can download the extension and change the file name suffix to XXX.zip, then unzip the file.

这篇关于在VSTS/TFS构建摘要中显示HTML内容,而无需使用清单文件中的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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