Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start TeamCity Build via REST Call

Tags:

teamcity

A little background.

In my environment we have a large number small .NET solutions each in their own Subversion repositories (500+). We not a TFS shop and are currently evaluating moving our home grown CI process to TeamCity.

Instead of having these 500+ repos polling our Subversion server every 5-10 minutes or so I'd like to kick off a Project build via a post-commit-hook REST http call (as our current solution does). I would then want TeamCity to update from SVN and commence the build process. Is this possible?

I see TeamCity has a REST API, just that the documentation is sparse. I'm not sure how this example ties to anything I've got configured. What is bt7? How does it tie to the projects I've configured?

http://buildserver:8111/httpAuth/action.html?add2Queue=bt7 
like image 474
ZaChickster Avatar asked Feb 24 '12 19:02

ZaChickster


1 Answers

bt7 is a build type identifier. Each build configuration has one. You can get the full list using the rest api as follows

http://buildserver:8111/httpAuth/app/rest/buildTypes

You can also see the build type in the url if you click any of the build configurations on your team city page. You will see a url parameter such as buildTypeId=bt7

like image 172
Mike Two Avatar answered Jan 02 '23 03:01

Mike Two