TFSBuild command line / vNext 2015

2019-06-24 15:12发布

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?

2条回答
迷人小祖宗
2楼-- · 2019-06-24 15:48

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
查看更多
Root(大扎)
3楼-- · 2019-06-24 15:57

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.

查看更多
登录 后发表回答