首页 > 解决方案 > 使用 HTTP URI 中的构建参数触发 TeamCity 构建

问题描述

我有以下 TeamCity 的构建配置(在 XML 中):

<?xml version="1.0"?>
<build>
  <buildType id="my_build_config_id"/>
  <comment>
    <text>mybuild</text>
  </comment>
  <properties>
    <property name="env.PARAM1" value="abc"/>
    <property name="env.PARAM2" value="xyz"/>
    <property name="env.PARAM3" value="123"/>
  </properties>
</build>

我可以使用他们的 REST API 触发构建,以下 XML 配置所述:

curl -v -u myuser:mypass http://teamcity.url:8111/app/rest/buildQueue --request POST --header "Content-Type:application/xml" --data-binary @build.xml

但是,我想在 URI 本身内编码我的所有构建参数。似乎没有清楚地记录如何使用所有编码为 URI 参数的 XML 来触发相同的构建。在字里行间阅读,它看起来像这样:

curl -v -u  http://teamcity.url:8111/httpAuth/app/rest/buildQueue?buildType(id:my_build_config_id),comment(text:mybuild),properties(property:((name:env.PARAM1,value:abc),(name:env.PARAM2,value:xyz),(name:env.PARAM2,value:123))) --request POST

我错过了什么?

标签: teamcityteamcity-9.0teamcity-8.0teamcity-7.0

解决方案


推荐阅读