【发布时间】:2015-01-21 11:57:37
【问题描述】:
我正在尝试通过 PowerShell 和 TeamCity 8 REST API 以自动方式将构建触发器添加到构建配置中。
使用以下问题作为参考,看来我正在尝试做的事情是可能的:Adding a Trigger to a build configuration in TeamCity using the REST API
但是,每当我尝试使用以下代码将触发器添加到构建中时,都会收到 (405) Method Not Allowed 错误:
$triggerXML= "<trigger id=`"TriggerID`" type=`"buildDependencyTrigger`">
<properties>
<property name=`"afterSuccessfulBuildOnly`" value=`"true`"/>
<property name=`"dependsOn`" value=`"BuildID`"/>
</properties>
</trigger>"
$webclient.UploadString('http://teamcity:8111/httpAuth/app/rest/buildTypes/BuildID', "POST", $triggerXML)
有人使用 PowerShell 成功实现了这一点吗?
【问题讨论】:
标签: rest powershell automation teamcity build-triggers