variables - 如何使用 TFS 构建有条件地跳过或执行任务/步骤?

我有一个 TFS 构建定义。

我希望有条件地运行两个执行两个命令行的步骤/任务。也许在我排队构建或其他东西时可以设置一个变量。主要是我希望运行构建并跳过一些步骤/任务,如果我愿意的话。我怎样才能做到这一点?除了制作一个执行我的 app.exe 的 bat 文件并向将执行或不执行我的 app.exe 的 bat 脚本发送一个 bool 变量。

最佳答案

2017/04/19 更新

你可以 specify conditions for running a task在 VSTS 中。

To use this feature you must enable both the New Build Editor and the Task Conditions preview features for your account.


目前,这是不可能的。 UserVoice 中有一个功能请求,并得到了STARTED的响应:

Allow build vNext/preview tasks to be conditionally enabled or disabled.

We have begun to work on this feature and it will be available on both team build and release management.

Team Services Group (Product group, Microsoft Visual Studio) responded · August 23, 2016

作为一种解决方法,您可以手动禁用构建任务(左键单击构建任务并选择禁用选定任务)如下截图:

https://stackoverflow.com/questions/40841173/

相关文章:

maven - 构建依赖项时如何使 Jenkins 触发依赖项目的构建

build - 没有缩小 JS 的 sencha 应用程序构建原生

build - 如何存储 CMake build设置

tfs - 调用执行程序时发生异常 'executor://xunit/VsTestRunner2/

delphi - 在 Delphi XE 中构建事件宏

java - 通过 Ant 编译 GWT

json - 从位于内存中的 JSON 加载启动配置

ios - 项目构建并运行,但不存档

android - 我可以从我的 Cordova config.xml 控制 AndroidMani

msbuild - 如何从外部文件中读取属性值?