0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Is it also possible to create build definition using scripts like Powershell. I dont have experience in .net coding
You can call the REST apis from powershell. blogs.msdn.microsoft.com/premier_developer/2018/04/21/…
Or use this module that already wraps some of these APIs in ready to use powershell functions: github.com/DarqueWarrior/vsteam
First, for Build Definitions, now called Build Pipelines, learn to use "Task Groups". I've learned about these and have greatly benefited from using the "fix once and apply everywhere" feature. Second, MS is working on turning Release Pipelines into YAML, but it is a future feature and not here yet. I am building my own solution described here: stackoverflow.com/questions/52323065/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.