kapil singh
kapil singh

Reputation: 31

create custom build definition in VSTS using script

I am creating CI/CD pipelines in VSTS using GIT repository.

I need to use the same steps from UI while creating build definition and release configuration for projects so i want to get off this repeating manual steps and create some automation around it so I don't have to do the same steps every time.

Can anyone tell me how it is possible using scripts or any other things?

Upvotes: 0

Views: 806

Answers (1)

jessehouwing
jessehouwing

Reputation: 114957

To create build definitions you have two options:

  1. Use the new YAML builds, which allows you to specify the whole build in a YAML file instead of UI elements.

  2. Use the Build Definition REST API create the definition locally in json form and submit it to VSTS in a single transaction. There is a nice PowerShell library called "VSTeam" which wraps the REST API functions in powershell cmd-lets.

Another thing to look at would be the use of Task Groups, these allow you to abstract away a sequence of tasks and turn those into a single reusable task.

Upvotes: 1

Related Questions