Display HTML content in VSTS/TFS build summary without using contribution in manifest file

坚强是说给别人听的谎言 提交于 2019-12-08 11:36:54

问题


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


回答1:


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

For example:

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

More information, refer to logging commands.

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.



来源:https://stackoverflow.com/questions/45222287/display-html-content-in-vsts-tfs-build-summary-without-using-contribution-in-man

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