The purpose of this tutorial is to demonstrate how you can add custom functionality to Bamboo via plugins. The tutorial aims to give you a good starting point for Bamboo plugin development, and how the different Bamboo plugin modules can work together. In this tutorial, we will run through the development of a plugin derived from a real use-case requirement.
Bamboo Labeller Plugin
There are many cases when builds in Bamboo fail because of particular, recurring errors. For example, a functional test in Confluence may periodically fail because of an OutOfMemoryError when things get hectic. It would be useful for developers to keep track of these particular builds, so they can look into it further. For this to happen, Bamboo will need to:
- Parse the error logs after a failed build.
- Look for the text
java.lang.OutOfMemoryErrorin the log
- If found, tag the build with a label, say
Once that's done, the developer can set up a RSS feed on the
out_of_memory tag. They will then be able to keep track of the builds which fail with an OutOfMemoryError. We can even extend this concept further, by replacing the search for
java.lang.OutOfMemoryError with any regular expression, tagging it with a label of choice.