Thursday, November 29, 2012

Dumping Atlassian Bamboo plans via REST and Perl

edit: Perl Weekly linked to this post, saying, "Unfortunately no explanation comes with the code, but if you like seeing actual uses of Moose roles in the wild, this might be a good opportunity for you." Please let me know in the comments what needs explaining. In the meantime I'll be editing the code on GitHub -- use Gist's fork feature if you'd like to make your own version.

Another Perl script from work, this one connects to an Atlassian Bamboo continuous integration server's REST API and dumps out information about a given project's build plans.

I'm using this to help me selectively port some build plans from one Bamboo server to another. Unfortunately Bamboo doesn't expose all plan information via the API, nor does it provide a way to make changes except through the interactive administration user interface.

As far as programming technique is concerned, this is a really nice demonstration of composing Moose roles for handling the REST client, HTTP authentication and command line parsing. Aside from the actual REST requests I just added an attribute to select the project ID, some additional usage documentation, and some convenience methods.

I like scripts like this because I don't think they need programmer comments -- if you know enough Perl then everything should be fairly obvious.

No comments:

Post a Comment