powershell - Update build definition in team foundation 2015 API -
i busy configuring our new tfs 2015 server (on premises) , trying new vnext builds work properly. have powershell scripts increase version number of assemblies. changes buildnumber in tfs calling api method (see tfs rest api). json body sends new build number (eg. {"buildnumber": "1.0.1.1234"}) , works fine.
now have added major, minor , patch version variables in build definition version. once build done should updated , thought same kind of thing , send update api call corresponding builddefinition endpoint. documentation says revision number mandatory have added that. rest added changed variables. api call works, nasty thing update whole definition , clear out other settings did not provide in json body. tried first getting defintion through api, changing json values variables , send didnt work correct also.
so know solution this?
as workaround did adding dummy build definition (eg. "_projectversion") totally empty except variables , build task uses build definition latest version numbers , update them. api call still empties whole build definition since contains variables dont mind.
i doing in powershell since scripting should automated , done in powershell.
problem have api call json of existing builddefinition returns invalid json when managed in powershell.
example "@{multipliers=[];
fail 'must have @ least 1 value' though 'json validator' may report valid. correct json {"multipliers": "[]",
Comments
Post a Comment