Trigger TeamCity build with build parameters in HTTP URI

266 views Asked by At

I have the following build config for TeamCity (in 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>

I'm able to trigger a build with their REST API as documented with this XML config:

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

However, I want to encode all of my build parameters inside the URI itself. it doesn't seem clearly documented how to trigger the same build with all of the XML encoded as URI parameters. Reading between the lines, it would look something like this:

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

What am I missing?

0

There are 0 answers