This is a guest post from David Cook–growth hacker at Jut, Atlassian alumnus, and possibly the fastest man on earth.
A few months ago, we realized we had a problem with our automated builds in Bamboo. There were some tests that only ran on master, and developers would sometimes merge in a branch that had passed locally, but would break on master. Then other developers would merge to master when it was broken–making it more difficult to figure out why the builds had broken in the first place. Eventually, we realized that people weren’t checking the status of master before merging because, well… it was a pain in the ass.
So we had two problems: master was breaking too often, and people didn’t know when it had broken. As a data nerd, I latched onto the latter problem. We hadn’t found a great way to communicate the status of master. Now, most people use wallboards as an information radiator. But I thought we could come up with a simpler–and cooler–solution: LEDs.
LEDs are the new wallboard
A wallboard is just a dashboard you display on a TV. Since it’s always on and, hopefully, always visible, it’s a great way to communicate information. But wallboards and dashboards aren’t the only methods for displaying information. Depending on what data you want to communicate, LEDs can work even better.
I setup an LED strip in a centrally-located part of the office that shows the status of builds on master. When any of the master builds fail, the entire LED strip will turn red. If they have all succeeded, then the strip is green. All our developers have to do before they merge their branch to master is look up and see what color the LEDs are. It couldn’t be simpler.
How to setup your LED information radiator
I’ve been playing around with the PixelPusher and LED strips in my free time and figured this would be a great use for them. The PixelPusher makes it relatively simple to control each LED individually using Processing, a java-based language and development environment for creating visuals. However, in order to get this program to run on our headless server, I couldn’t use Processing, so the code is pure Java.
I wrote a Python script to hit Bamboo’s API and check the status of each master build. Cron executes this script every two minutes. If any of the builds have failed, it writes “Failed” to a text file. Otherwise, it writes “Successful” to the file. This file is checked every minute by the Java program in our closet, which will change the color of the LEDs based on the contents of the file.
This is easily extendable to incorporate other builds or other branches. For example, we can divide the strip in half so that one side of the strip represents master and the other represents staging. We use the LEDs to display other kinds of information too. Stay tuned to find out what else we use them for!
Interested in doing something similar? Check out the code here.