405 Only POST method is allowed for this request issue

Hello. I am trying to trigger TeamCity build via command line.

curl http://<user name>:<user password>@<server address>/httpAuth/action.html?add2Queue=<build configuration Id>

But got the following answer:

405 Only POST method is allowed for this request

How I can trigger TeamCity build via command line in such conditions?

Thank you.

1
2 comments
Avatar
Permanently deleted user

As I understand the solution could be via REST API

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

Example of build.xml

<build>
<buildType id="buildConfID"/>
</build>

But for me is not clear where should I store my configured build.xml???

0

Hi,

 

you should store in the folder where you are running curl from, as curl will take it from there. Alternatively, you can pass the data as a string.

 

Regarding your first usage, it's discouraged and the REST API is preferred, as you mentioned.

0

Please sign in to leave a comment.