How to retrieve server info from Agent? REST API Plugin!

Hi there,
I am trying to write my first team city agent plugin and a need to retrieve some server info related to previous builds (start time of last successful build, start time of last failed build etc etc).

Should I use the Rest Api from the agent side code to retrieve this info.

Thanks.

Roberto

3 comments

Roberto,

Using REST API (if it provides information that you need) is probably the easiest way to get the information without server-side TeamCity plugin.

But if you need that kind of information you probably need server-side plugin. Server-side plugin can then add properties to the starting builds, if necessary.

Can you describe what kind of plugin do you write?

0

Hi Yegor,

thanks for your answer. I will try it. I will use a jetbrains.buildServer.serverSide.ParametersPreprocessor in the server side part of my plugin.

What I want to do is a plugin that gives you all (even if the belong to "sub-project") the subversion changes that could have caused a build to fail.

At the moment, if I am not wrong, teamcity triggers a build if it detects changes in SVN or (supposing you are using Maven as build tool) if you use a Maven Snapshot Dependencies Trigger.

The problem with the second option is the following one :

Suppose I have project A (artifact a.jar) that depends on project B (artifact b.jar) that depends on project C (c.jar).
Suppose that I register all my maven and SVN triggers and somebody change sources in C (c.java changes) : a trigger builds c.jar, a second build builds b.jar and a third build (project A) tries to build a.jar.

Now if build in project A failed (because for example what have been committed on C, c.java, is wrong) I dont know immediately from my teamcity A project report that somebody changed c.java, and will take time to find out that
c.java was the cause of the problem.

I would like to write a plugin that when A build fails it finds all A dependencies (from pom.xml) and reports all SVN changes that could have caused the build to fail, even changes in all its dependencies.

I hope this is clear.

What do you think?

Roberto

Message was edited by: roberto malagigi

0

Roberto,

> I will use a jetbrains.buildServer.serverSide.ParametersPreprocessor in the server side part of my plugin.
Sounds OK.

Yes, you are addressing a known issue and at some point we should implement it as a feature in TeamCity.
You might be interested in voting/watching the issue TW-2576 (Include changes from changed artifact dependencies in the build's change) and it's related issues.

Please consider sharing the plugin with the rest of TeamCity users!

0

Please sign in to leave a comment.