【问题标题】:How do I specify build arguments when starting a TFS build from the command line with tfsbuild.exe?使用 tfsbuild.exe 从命令行启动 TFS 构建时,如何指定构建参数?
【发布时间】:2017-04-25 17:10:19
【问题描述】:

对于我的团队构建流程,我创建了控制部署的工作流活动。我想在运行时选择是否部署构建。

因此,我需要发送Deploy=truefalse 作为工作流运行时启动的输入。

我可以通过使用内部参数定义工作流自定义元数据值来做到这一点。然后,我可以在运行时通过 Parameters 选项卡下的 Queue Build 对话框设置 Deploy 值。

我的问题是:在使用tfsbuild.exe start 从命令行启动 TFS 构建时如何指定我的自定义变量?

【问题讨论】:

  • Curt,你有没有找到解决方案?我找到了您在 VS Team Foundation 论坛上提出的问题,但也没有得到解答。您是否知道如何将参数从命令行传递到构建工作流程?

标签: tfs tfsbuild


【解决方案1】:

命令行参数调用/msBuildArguments

TfsBuild start teamProjectCollectionUrl teamProject definitionName
               [/dropLocation:dropLocation] [/getOption:getOption]
               [/priority:priority] [/customGetVersion:versionSpec]
               [/requestedFor:userName] [/msBuildArguments:args] [/queue]
               [/shelveset:name [/checkin]] [/silent]

您可以使用:tfsbuild start http://yourserver:8080/tfs/ YourProject YourBuild Definition /msBuildArguments:"Deploy=true"

【讨论】:

  • 附带说明,如果将 TFS 与 Git 一起使用,并且您想指定提交 ID(哈希),语法如下: TFSBuild start teamProjectCollectionUrl teamProject definitionName /queue /getOption:Custom /customGetVersion: LG:ref:
猜你喜欢
  • 2017-11-23
  • 1970-01-01
  • 2012-09-01
  • 2014-03-18
  • 1970-01-01
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 2016-10-11
相关资源
最近更新 更多