Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2017 build as code

How I can configure the build tasks in 2017 within "build" and "release" as code? I am searching for something like the Jenkinsfiles for the Jenkins Pipelines.

Use case is:

  1. I need to validate params and then decide which tasks I call in which order etc. based on globally passed parameters
  2. Don't have the only source of changes in a web UI
  3. Have the configuration in source control

Is there may be a possibility or a Plugin available doing this?

like image 549
aumanjoa Avatar asked Aug 24 '26 16:08

aumanjoa


2 Answers

There's no out of the box way. There are marketplace tasks to export build and release definitions as JSON, and you can use the REST APIs to create or update build and release definitions. Combine those things, and you certainly can achieve what you want. I've had some success with scripting build/release definition creation via PowerShell against TFS 2015 and VSTS.

like image 57
Daniel Mann Avatar answered Aug 28 '26 17:08

Daniel Mann


What you've requested is currently not possible. There is a proposal out on the Visual Studio Agent GitHub site asking for feedback and with a proposal to do most of what you want.

I suggest subscribing to that topic and providing what feedback you'd like to contribute. There is currently no indication to a timeline to when this new yaml based build will be available though.

You could indeed cobble something together with the REST API to download the json for the build whenever it changes and put it in source control. You could update the build whenever a new json is committed. But given that Microsoft is working on enabling your scenario in the product, I'd recommend to wait out a while longer.

like image 22
jessehouwing Avatar answered Aug 28 '26 15:08

jessehouwing



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!