tfsbuild - Error code 255 when trying to kick off a TFS2013 team build via a PostBuildEvent -
i'm trying kick off team build when team build finishes, i've added .csproj of project being built:
<propertygroup condition=" $(isdesktopbuild) == 'false' "> <postbuildevent> <command> cmd /c "c:\program files (x86)\microsoft visual studio 12.0\common7\ide\tfsbuild.exe" start /collection:http://server/collectionname /builddefinition:\builddefinitionname </command> </postbuildevent>
i've tried without cmd /c , doesn't help. tried without command /command around it, same error no matter option choose. if copy , paste command dos window works fine. error is:
c:\program files (x86)\msbuild\12.0\bin\microsoft.common.currentversion.targets (4548): command "<command xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> cmd /c "c:\program files (x86)\microsoft visual studio 12.0\common7\ide\tfsbuild.exe" start /collection:server/collection /builddefinition:\builddefinitionname </command>" exited code 255.
i took @andy-msft's advice , wrote powershell script rest call server , same result:
here's powershell script wrote:
when run script command line works fine. , can run twice in succession, it's not case of not being able run while build running.
update 7/29/17
i took @andy-msft's latest advice , added exit last line of powershell script , still error:
notice command @ end of error message, took out command /command xml , this:
the error changed 255 123. ideas means?
update 7/31/17 @eddie - msft added tfsbuild postbuildevent suggested , this:
here's postbuildevent looks like:
update 2 - 1/31/17 @andy-msft & @eddie - msft got initial build run using following afterbuild target, doesn't (it doesn't kick off build). there's no mention of in log either:
update 3 - 7/31/17 tried adding debugging info powershell script (see below), write text file when script starts , again try write result of call kick off build. in cases writes first file know script starting. if run command-line file result.txt full of text resulting build, when run afterbuild target file empty. not sure if helps, thought relevant:
update 8/1/17 in response latest comment @eddie - msft
yes - tried that. builds, call doesn't seem work. no error messages, no build kicked off. here's call:
and here's log shows presumably being kicked off, not:
update 8/1/17 8:51am pt got build appear kick off (i captured result call in powershell script , wrote file here, build still doesn't kicked off.
i can reproduce issue, reason can not start build within build processing. means can use command start new build after previous 1 completed. can check running command when build running, receive error accordingly.
so, can not use postbuildevent or post-build script achieve that.
you can try use rest api request new build, queue builds.
Comments
Post a Comment