Friday, November 16, 2007

Cruise Control Remote Management API

I've never contributed to an OSS project before. Why that is I'm not quite sure. Looking through the CruiseControl Java code its pretty clear to me that I have the skills. I understand the code and I understand ways that I could refactor and improve it. I understand that I probably had those skills years ago. So why I haven't is beyond me; maybe I just never had the confidence.

Anyway, I've finally submitted something. I wrote a CruiseControl Remote Management library that wraps the exposed JMX attributes and operations for a server and its projects. You can do nice things like getting a reference to a server, getting all its projects, force builds on projects, set labels on projects, lots of nice stuff. Here's a simple example that forces a build on all projects:

CruiseServer server = new Server("localhost");
List projects = server.getProjects();
for( CruiseProject p: projects ){ p.forceBuild(); }



You could do nice things with Build Pipelining like trigger builds in other CruiseControl instances on different servers after a project on your server builds. Indeed, thats actually what I've done.

I think that this code could be used to clean up a lot of the code in their current tree. Maybe I'm wrong, or maybe they already have something like this, but I didn't see it.

Hopefully they will take this and add it in. Maybe they will ask me to add it in. Maybe I'll get to refactor a bunch of their Dashboard code. I'm almost certain it would be cleaner using this.

We'll see what happens.

4 comments:

  1. Did they add it? Im looking for a remote API for cruise control and I googled this post. where can I find this library?

    Thanks,
    Moshe

    ReplyDelete
  2. I don't believe they did.

    I could dig up the code and get it to you, if you'd like.

    ReplyDelete
  3. I also would like to get the code if possible, I am in the process of writing some custom code for the web interface and could use some tie in to the projects themselves via an API.

    Thanks,
    John

    ReplyDelete
  4. Hi there,

    I'd like to take a look at your client, too. Is there any chance to get the sources?

    Regards,
    Mario

    mario.mueller.work at gmail dot com

    ReplyDelete