我有一个从 2015 vNext 团队构建调用的 PowerShell 脚本 (Start-TargetBuild.ps1)。此脚本使用 REST 接口(interface)启动另一个团队构建。该脚本工作正常,除非我尝试将搁置集添加到初始构建。在这种情况下,我会收到以下错误:
Start-TargetBuild : Error in REST API call!
At \\chdfileserver01\IT\PowerShell_Library\TeamBuild-Launch.ps1:426 char:2
+ Start-TargetBuild
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : {"$id":"1","innerException":null,"message":"Value cannot be null.\r\nParameter name: build","typeName":"System.ArgumentNullException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561
934e089","typeKey":"ArgumentNullException","errorCode":0,"eventId":0}.ErrorDetails.Message,Start-TargetBuild
我错过了什么?
谢谢。
最佳答案
要触发带有搁置集的构建,您应该在 REST API 中使用 sourceBranch 参数 body 。
sourceBranch: "The shelveset name","The shelveset owner"
关于rest - 如何使用 REST API 在 TFS 2015 中使用搁置集触发构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42844102/