Launching a build using REST API with a Git branch name as a parameter
Hi.
I have a Git VCS root with the default branch set as "master" and the Branch Specification set using a build parameter %BRANCH_NAME%.
I want to start this build (with buildTypeId==bt2) with a branch name = "foo". Here is what I've tried, but I want to verify this is the correct form:
$ curl -i -u u:p "http://localhost:8111/httpAuth/action.html?add2Queue=bt2&name=BRANCH_NAME&value=foo"
Is this correct?
Thanks.
Please sign in to leave a comment.
Not exactly. A correct syntax is
Thank you.
Your form works.
If I did have a parameter I wanted to inject into the build config, what syntax would I use?
And how did you know to use branchName as a key in the query params?
Mark
We have such example on Accessing Server by HTTP page. The syntax for passing parameters is http://teamcity/httpAuth/action.html?add2Queue=bt1&name=property1&value=value1&name=property2&value=value2
Actually, I used Fiddler to grab HTTP traffic between a browser and TeamCity web server.
The web page makes POST-request to runCustomBuild.html page, but you make a similar request using GET method to action.html page.