如何在TeamCity中有条件地运行构建步骤 [英] How to run a build step conditionally in TeamCity

查看:105
本文介绍了如何在TeamCity中有条件地运行构建步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是此问题的更通用版本:如何仅在特定分支上运行构建步骤?

This is a more generic version of this question: How to run a build step on a specific branch only?

例如,如果'%teamcity.build.branch.is_default%' -eq 'true''%teamcity.build.branch%' -eq 'master',我可以使用PowerShell脚本运行MSBuild,但是随后,我将错过TeamCity MSBuild构建运行程序随附的可折叠日志.有没有更简单的方法来有条件地运行构建步骤?

For example, I can use a PowerShell script to run MSBuild if '%teamcity.build.branch.is_default%' -eq 'true' or if '%teamcity.build.branch%' -eq 'master' but then I will miss the collapsible log that comes with the TeamCity MSBuild build runner. Isn't there any easier way to conditionally run a build step?

推荐答案

无法根据条件执行构建步骤.对相关请求进行投票: https://youtrack.jetbrains.com/issue/TW-17939.
推荐的方法是为每个分支创建单独的构建配置.您可以使用模板来简化设置.在这种情况下,将更容易解释结果,并且构建的统计信息将为您提供有益的信息.
另请参阅相关的答案(建议使用hack).

It is not possible to execute build step based on condition. Vote for the related request: https://youtrack.jetbrains.com/issue/TW-17939.
The recommended approach is to create separate build configuration for each branch. You can use templates to simplify the setup. In this case it will be easier to interpret the results and the statistics of the builds will be informative.
Also see the related answer (hack is suggested).

这篇关于如何在TeamCity中有条件地运行构建步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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