TfvcRelease12 构建模板 2013.4 中的流程令牌
Process tokens in TfvcRelease12 build template 2013.4
如何在 TFS 和 Release Management 2013.4 的 TfvcRelease 12 构建模板中处理令牌?我有 web.config 和 web.config.tokens 文件。我见过这样的:
http://www.colinsalmcorner.com/post/webdeploy-and-release-management--the-proper-way
但看起来这也是一个解决方案:
/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false
在构建过程模板的发布部分将 "Process tokens" 标志设置为 true 并确保 web.config.token
文件设置为 "Copy Always" 在应用程序的项目文件中。
另一个我取得了一些成功的选项是为发布构建配置定义一个 web.config 转换。在转换中,将 web.config 中的基线值替换为标记。然后,打开项目文件并添加此片段:
<Target Name="AfterBuild">
<TransformXml Condition="Exists('$(OutDir)\_PublishedWebsites$(TargetName)')"
Source="Web.config"
Transform="$(ProjectConfigTransformFileName)"
Destination="$(OutDir)\_PublishedWebsites$(TargetName)\Web.config" />
</Target>
[Source]
该代码段将强制配置转换为 运行,但前提是它是在 TFS 构建服务器上构建的。效果非常好。
注意:所有这一切都是在构建过程中将 web.config.token
文件复制到 web.config
文件上。然后由您在 RM 中定义组件中的标记,然后在发布模板中提供值。
两者都有效,但我更喜欢 /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false 因为它更干净。我有一个博客 post here that gives the details of how to set this up. Another of my posts explains the process of actually replacing the tokens with values for the environment being deployed to in an agent-based scenario. I'll have a PowerShell version of this available sometime this week as part of my Continuous Delivery with VSO 系列
如何在 TFS 和 Release Management 2013.4 的 TfvcRelease 12 构建模板中处理令牌?我有 web.config 和 web.config.tokens 文件。我见过这样的:
http://www.colinsalmcorner.com/post/webdeploy-and-release-management--the-proper-way
但看起来这也是一个解决方案:
/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false
在构建过程模板的发布部分将 "Process tokens" 标志设置为 true 并确保 web.config.token
文件设置为 "Copy Always" 在应用程序的项目文件中。
另一个我取得了一些成功的选项是为发布构建配置定义一个 web.config 转换。在转换中,将 web.config 中的基线值替换为标记。然后,打开项目文件并添加此片段:
<Target Name="AfterBuild">
<TransformXml Condition="Exists('$(OutDir)\_PublishedWebsites$(TargetName)')"
Source="Web.config"
Transform="$(ProjectConfigTransformFileName)"
Destination="$(OutDir)\_PublishedWebsites$(TargetName)\Web.config" />
</Target>
[Source]
该代码段将强制配置转换为 运行,但前提是它是在 TFS 构建服务器上构建的。效果非常好。
注意:所有这一切都是在构建过程中将 web.config.token
文件复制到 web.config
文件上。然后由您在 RM 中定义组件中的标记,然后在发布模板中提供值。
两者都有效,但我更喜欢 /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false 因为它更干净。我有一个博客 post here that gives the details of how to set this up. Another of my posts explains the process of actually replacing the tokens with values for the environment being deployed to in an agent-based scenario. I'll have a PowerShell version of this available sometime this week as part of my Continuous Delivery with VSO 系列