-2

Our project is using TFS 2017, we have more than 20 builds created for a single release so for next release we have to again create these builds with different release number and server to be deployed name. Can we have an automated process to create these builds at once using some script or any tool is there with the help of which we can easily create builds or powershell script that can help for the same.

Ayush
  • 83
  • 3
  • 10

1 Answers1

0

You could use TFS REST API to programmatically create and update build definitions.

Just use a JSON file to set up a vNext build definition, then use the Invoke-RestMethod to get it running.

Create a build definition:

POST https://{instance}/DefaultCollection/{project}/_apis/build/definitions?api-version={version}

Update a build definition:

PUT https://{instance}/DefaultCollection/{project}/_apis/build/definitions/{definitionId}?api-version={version}

For more detail steps you could refer below tutorials:

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks for your help, I will try this one. Will need your help if face any issues. Thanks a lot. – Ayush Nov 29 '17 at 00:11