Starting a new build trough REST api

Hey,

I've been browsering the rest api plugin sourcecode, and found the syntax for all the different queries I need to extract the data from teamcity that I need.

Except one

I can't seem to find the url which lets me start a build of a certain buildconfiguration, and then gives me the buildnumber back, so I can track it's progress as it goes from the queue, to a buildagent, to being succesfully completed.

Does anybody know if the REST api will already let me do this?

Thanks, Lucas

3 comments
Comment actions Permalink

Lucas,

REST API does not yet support starting of builds. We certainly plan to add the ability.
For now, you can use non-REST approach described in the doc.

Another current possibility is to branch the REST API plugin for yourself and add the logic you need (and maybe send us a patch later).

Actually, just starting a plain build is quite an easy task, but the API should cover all the abilities of Custom Build Run dialog, and more.

One more note: as starting a build just puts it into the queue and build number is assigned to the build on its starting, most probably you will not be able to get the number on start build request. An internal id can be returned back that can later be used to get the build.

0
Comment actions Permalink

Hey Yegor,

Being able to get some token when starting a build, that can later be used to get the actual buildnumber once it has started would work great.

I was hoping to stay out of custom plugin development though , we'll see how realistic that is.   Hopefully I'll be able to use the non-REST api
(without the token stuff offcourse, but it would already be quite nice if I can just start it),  however I do need to start it at a specific revision.
The documentation says I could use:

//testuser:testpassword@teamcity.jetbrains.com/httpAuth/action.html?add2Queue=bt10&modificationId=11112
and then says that modificationId is "internal TeamCity server id which can be obtained from the web diff url."
I think I"m missing the part where I can go from "I want to build svn rev 345334",  to "that is modificationID 100 is teamcity".
If I can map a svn rev to this modificationID thing, it looks like I"m pretty much good to go. Do you know how I can
get my hands on the modificationID ?

Thanks, Lucas
0
Comment actions Permalink

Lucas,

TeamCity can only start builds on the changes detected by TeamCity. (I mean if the change was not detected, there is no way to start a build for it).

You can list the detected changes via REST. e.g. use the request:
http://<server>/app/rest/changes?project=id:<internal_project_id_like "project25">
the "id" of the "change" element would be that internal modificationId

0

Please sign in to leave a comment.