how to pass Environment variables in a curl command

Answered

I have a curl command that triggers a build in TeamCity: 

curl -X POST -u <user>:<pass> -d ‘<build><buildType id=“<buildId>”/></build>’ http://<url>/httpAuth/app/rest/buildQueue --header “Content-Type: application/xml” -H “Accept: application/json” || true
How do I pass an environment variable In this CURL call? e.g env.buildId, env.suite, etc....

0
1 comment

Hello!

A modified example of -d payload could look like this:

<build>
<buildType id=“<buildId>”/>
<properties>
<property name="env.buildId" value="someId"/> <property name="env.suite" value="someSuite"/> </properties>
</build>

You can check this article for more examples of REST API usage: https://www.jetbrains.com/help/teamcity/rest-api-reference.html#Triggering+a+Build
Please let me know if this helps.

0

Please sign in to leave a comment.