API for build promotion levels

I would like to configure a TeamCity pipeline that uses the concept of build promotion to integrate with outside tools.  I have done something similar with Jenkins using the Promoted Builds Plugin.  Basically you set up a number of promotions for the initial build/compile job that can be dependent on each other to form a heirarchy.  As the build progresses and passes certain milestones, the build can be "promoted" which can trigger other jobs, etc.  Through their REST API, you can query the most recent build at a certain promotion level and can trigger a "manual" promotion via the API as well.

How can I do the same thing in TeamCity?  I don't see an API for promotion and it seems like the promotion lives on each "downstream" build configuration, not the initial build configuration.  Or is there is a way to do this via some other mechanism without resorting to coding a plugin?

4 comments
Comment actions Permalink

Hi,

You can do the same thing in TeamCity using different build configurations and snapshot/artifact dependencies. For more details please read related blog post http://blog.jetbrains.com/teamcity/2012/04/teamcity-build-dependencies-2/. Using REST API in TC you can get different information of build configuration or trigger them.
Please watch/vote/comment this related issues - http://youtrack.jetbrains.com/issue/TW-18010.

0
Comment actions Permalink

Yes, I have read that blog post (you can see a similar question by me there [actually maybe you can't--it is still "awaiting moderation"]) and I have looked at the API doc.

If you look at the section in the blog post "Promoting Finished Builds", see the screenshots for selecting the "Promote..." action for a given build chain?  How do I do that via the REST API?

I need to be able to programmatically identify a chain that is at a particular stage and then continue/run the next build configuration "in that chain".

Thanks.

0
Comment actions Permalink

Sorry for delay.
Could you please describe in more details your use case? What for do you need such behavior?

0
Comment actions Permalink

I think exactly what D Soa is talking about , basically in jenkins job you using plugin , you would specify you promotion criteria with some sort of keyword defined (lack of better word ), and once build has successfully passed the Dev Cycle , you would promote the build into QA env manually (which would also be visible in jenkins) so on a so forth.

That plugin was very useful in an environment where you had separate team deployment code to production and QA (they would have their own login so they can see what build(s) have been promoted than deploy.

Outside teamcity similar behavior can be achieved by binary repository such as artifactory however article you mentioned @Alina basically promotes the artifact (code or whatever) from one TC job to another.

 

 

 

0

Please sign in to leave a comment.