[英]How to pass TFS build variable to TFS email alert xsl file
I am trying to trigger customized email alerts after a build is complete. 构建完成后,我试图触发自定义的电子邮件警报。 I have a set of test results stored in the build agent (hosted using IIS).
我在构建代理(使用IIS托管)中存储了一组测试结果。 I use TFS variables to store the path of the log results:
我使用TFS变量来存储日志结果的路径:
$(LogsPublishDirectory)\AppName_$(Build.BuildNumber)
I need to include, in the email, the information to access these logs (as a link) such as : 我需要在电子邮件中包含访问这些日志(作为链接)的信息,例如:
http://123.456.789.00:5555/AppName_$(Build.BuildNumber)
From the MSDN link( https://msdn.microsoft.com/en-us/library/bb552337(v=vs.120).aspx ), I figured I need to modify the XSL file of the build job. 通过MSDN链接( https://msdn.microsoft.com/en-us/library/bb552337(v=vs.120).aspx ),我认为我需要修改构建作业的XSL文件。
My question is: 我的问题是:
How to edit the xsl file? 如何编辑xsl文件?
First to perform these procedures, you must be a member of the Administrators security group on the Team Foundation application-tier server. 首先要执行这些过程,您必须是Team Foundation应用程序层服务器上Administrators安全组的成员。
Drive:\\%programfiles%\\Microsoft Team Foundation Server 14.0\\Application Tier\\TFSJobAgent\\Transforms\\1033
Drive:\\%programfiles%\\Microsoft Team Foundation Server 14.0\\Application Tier\\TFSJobAgent\\Transforms\\1033
Here is the snippet of code to add a hyperlink to Bing . 这是向Bing添加超链接的代码段。
<xsl:call-template name="link">
<xsl:with-param name="format" select="'html'"/>
<xsl:with-param name="link" select="'http://www.bing.com'"/>
<xsl:with-param name="displayText" select="'Bing'"/>
</xsl:call-template>
The variable will not change to the correspond value in the XSL file and e-mail. 该变量将不会更改为XSL文件和电子邮件中的相应值。 A workaround could be subscribe to the Event Service via TFS API and create your own e-mails.
解决方法是通过TFS API订阅事件服务并创建您自己的电子邮件。 It's probably more work than you need to though.
不过,这可能比您需要的工作还要多。
Check this blog for further information: TFS 2012 API Create Alert Subscriptions . 请查看此博客以获取更多信息: TFS 2012 API创建警报订阅 。 It applies to TFS2015 as well.
它也适用于TFS2015。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.