Kyle Gray
Kyle Gray

Reputation: 1

How can I pass build variables to VSTS through the VSTS CLI?

I am trying to use the VSTS-CLI to kick off a build with different build variables. I have been able to kick off the build using this command:

 -/Users/ksg01/lib/vsts-cli/bin/vsts build queue --definition-name PointToPoint-nLightAir-Automation --open  --source-branch develop --instance xxxxxxxxxxxxxxx --project xxxxxxxxxxxxxxxxxxx

These are the build variables I am trying to update.

But I haven't been able to find a parameter for me to pass in the build variables. How can I do this? Or is there a resource that will help?

Upvotes: 0

Views: 322

Answers (2)

MikeP
MikeP

Reputation: 11

Although it does not appear to be documented in any of Microsoft's documentation if you ask for help from the command line (vsts build queue -h) it describes a --variables property that can be used to pass in space separated "name=value" pairs. I've successfully used it to pass an msbuild property to my build definition (vsts build queue --definition-name mybuild --variables myvar=value).

Environment info: vsts cli 0.1.1, Visual Studio 2017

Upvotes: 1

Kyle Gray
Kyle Gray

Reputation: 1

The VSTS CLI does not have the ability to add parameters as far as I could tell. Using Postman's CLI tool Newman I was able to send a query to the VSTS REST API and queue a build.

Upvotes: 0

Related Questions