TFSBuild command line / vNext 2015

喜欢而已 提交于 2019-12-10 16:50:04

问题


Premise: I think this is a bug/missing functionality in TFS 2015

When I create a new Build (non-xaml) definition using the TFS website, I am not able to call it using the command line TFSBuild start command.

If I create a standard XAML definition, I can start it using the command line.

Any idea if the command line is not able to start a new-style definition?


回答1:


The TFS Build vNext is an entirely new feature in 2015. Hence, I doubt that it can be addressed by the old API (available pre-2015). On the other hand, tfsbuild.exe is unlikely to contain the code to work with the new REST API. I would say it is expected behavior.

then what's the eway to start a TFS Build vNext from command line?

I'm not aware about an ad-hoc tool, but you can achieve the similar effect with Invoke-RestMethod and TFS REST API.




回答2:


You can use the tfs-cli node package to invoke builds from the commandline. After installign it, you can use it from a normal commandline in Windows, given that the Node\bin directory is added to your path environment variable.

Syntax:
tfx build queue --arg1 arg1val1 arg1val2[...] --arg2 arg2val1 arg2val2[...]

Command: queue
Queue a build.

Arguments:
  --project          Project name.
  --definition-id    Identifies a build definition.
  --definition-name  Name of a Build Definition.

Global server command arguments:
  --auth-type    Method of authentication ('pat' or 'basic').
  --username     Username to use for basic authentication.
  --password     Password to use for basic authentication.
  --token        Personal access token.
  --service-url  URL to the service you will connect to, e.g. https://youraccount.visualstudio.com/DefaultCollection.
  --fiddler      Set up the fiddler proxy for HTTP requests (for debugging purposes).
  --proxy        Use the specified proxy server for HTTP traffic.

Global arguments:
  --help       Get help for any command.
  --save       Save arguments for the next time a command in this command group is run.
  --no-prompt  Do not prompt the user for input (instead, raise an error).
  --output     Method to use for output. Options: friendly, json, clipboard.
  --json       Alias for --output json.

To see more commands, type tfx build --help


来源:https://stackoverflow.com/questions/32326058/tfsbuild-command-line-vnext-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!