Custom Build Indicator Lamp...

Is there an API available to allow us to write our own build notification indicator? We migrating away from CruiseControl.NET where we are using a full size stoplight in our lab and an Ambient Orb in the managers office as our build indicator lamps.

Green= All Builds Pass
Red= Any failure anywhere.
Yellow= Building.

(Here is a link to our CC.NET source for the Ambient Orb:
http://www.agileskunkworks.org/home/Articles/TheOrbBuildIndicatorLamp/tabid/114/Default.aspx)

Thanks in advance,

Luke Lanphear
Eclipse Software Systems, Inc.

8 comments

Hello,

I see at least two ways to do this:
1) you can write your own BuildServerListener and watch for all events about
builds
2) you can write custom notifier (see Notificator interface)

The second option will allow you to customize watched build configurations
via web UI without additional efforts from your plugin.

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Luke Lanphear" <no_reply@jetbrains.com> wrote in message
news:9342435.1201632160638.JavaMail.itn@is.intellij.net...

Is there an API available to allow us to write our own build notification
indicator? We migrating away from CruiseControl.NET where we are using a
full size stoplight in our lab and an Ambient Orb in the managers office
as our build indicator lamps.

>

Green= All Builds Pass
Red= Any failure anywhere.
Yellow= Building.

>

(Here is a link to our CC.NET source for the Ambient Orb:
http://www.agileskunkworks.org/home/Articles/TheOrbBuildIndicatorLamp/tabid/114/Default.aspx)

>

Thanks in advance,

>

Luke Lanphear
Eclipse Software Systems, Inc.



0

Luke,

Full size stoplight is a cool feature! We should really consider bundling those with TeamCity ;)

As Pavel noted, you may write a Java plugin that gets access to all the build events and acts when needed. Another possible approach is to use XML-RPC queries to the server and get all the information remotely, as our plugins for IDE do.

Please let us know if you need any help with either approach.

And do not forget to ping us when your stoplight gets connected to TeamCity!

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Do you have any documentation on using XML-RPC to query the server?

I will be glad to give you our implementation and a list of hardware we used. :)

--Luke

0

Luke,

We do not have XML-RPC protocol documented at the moment (there is still much to add into our open API documentation, but we are working on it).

Actually, if you prefer remote queries to the server, it may be easier (and more proper) to use our library (.Net and Java versions available) that already implements the protocol and exposes higher-level objects via its API. Please note that the protocol (and library API) can change between TeamCity releases.

Right now we are making some changes into the client API, updated version will be available in TeamCity 3.1 that should be released this month.

There is no description of the client API yet, but we will provide a brief one.

Is approach with using our client library suits your needs? Can you wait till 3.1 release to use this newer API?

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

I am doing a .NET SIG presentation next week on automating the build process (Using TeamCity of course). I was hoping to be able to haul our stoplight along. However, I don't want to make any extra work for you. (I would rather see 3.1 released sooner). Can you simply point me in the direction of getting my hands on the .NET version of the client API? Please don't spend ANY time on this and definitely don't worry about documentation. If I can figure it out on my own, great. If not, I will be glad to wait for the 3.1 release.

Very truly,

Luke Lanphear

0

Luke,

Seems, I misinformed you and was wrong myself (some swapping of topics in my head occurred, sorry). After consultations with developers, it became apparent that .Net client API (the one enclosing XML-RPC) is not that ready for external use and will probably not be ready for some time still. Communications via XML-RPC are possible, but we do not have the protocol documented yet.

For the time being the most appropriate approach for your task seems to be writing a piece of Java code that will work as TeamCity plugin and will do the calculations on the server-side, while providing the result to external requests (e.g. via HTTP) I can assist you if the approach is suitable.

As an example I am attaching a simplistic plugin that returns "red" if there is a failing build or "green" otherwise. How to use it: place genStatus.jar from the archive into
\webapps\ROOT\WEB-INF\lib directory and restart the server, navigate to http://]]>/genStatus.html

Again, sorry for misinforming you in my previous post.

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



Attachment(s):
genStatusPlugin.zip
0

Thank you very much! Sorry it took me so long to reply. I gave up on getting the stop light working before my presentation. However, I am back at it and was able to user your example to get me started. I changed it to add a "Building" status where we turn the stop light yellow. Here is my code:

boolean allBuildsSuccessful = true;
boolean building = false;
String trace = "";
Iterator it = myServer.getProjectManager().getAllBuildTypes().iterator();
while (it.hasNext()) {
SBuildType buildType = (SBuildType) it.next();
//trace += "buildtype: " + buildType.getFullName();

SBuild lastStartedBuild = buildType.getLastStartedBuild();
if ((lastStartedBuild != null) && (!lastStartedBuild.isFinished())) {
building = true;
//trace += " building=true ";
}

SBuild lastFinishedBuild = buildType.getLastFinished();
if (lastFinishedBuild != null) {
boolean lastBuildStatus = lastFinishedBuild.getStatusDescriptor().getStatus().isSuccessful();
allBuildsSuccessful = allBuildsSuccessful && lastBuildStatus;
//trace += " status=" + lastBuildStatus;
}
}
String responseText;
if (building) {
responseText = "yellow";
} else if (allBuildsSuccessful) {
responseText = "green";
} else {
responseText = "red";
}

Now, we have to deploy this to a real box and change our buildIndicator Service to check StopLightStatus.html instead of CC.NET.

We are making a new stoplight. I will take pictures of the circuit board and document the entire process. I will let you know once we get it done. (Probably a month from now.)

Again, thanks

Luke Lanphear
Eclipse Software Systems, Inc.

0

Man, I feel so drab and uncreative using measly lava lamps :). I have nowhere near the component skills that it sounds like Like has, nor am I very comfortable in the Java world (.NET junkie).

If anyone knows of an easy way to send a message to a simple device like the X10 Firecracker that can control a standard plug-in type appliance, let me know. Until then, I'll use the awesome web interface of TeamCity! I am extremely impressed with the product after some minor hurdles during my initial install.

0

Please sign in to leave a comment.