Github Information Radiator

16 Oct 2015

Our CI/CD pipeline relies heavily on Github, among other things.

We’ve got proper monitoring using New Relic, AWS Cloudwatch and Pingdom and alerting via PagerDuty and Slack and all that.

But I decided to go one step further and build an information radiator that changes colors based on Github’s status:

Github Information Radiator

Ingredients

5” Octocat Figurine 5" Octocat Figurine

Philips Hue Go Philips Hue Go

Philips Hue Hub Starter Kit Philips Hue Hub Starter Kit

Raspberry Pi Raspberry Pi

$ cat poll_github.sh

#!/bin/bash

# poll global github status api

HUE_HOST=192.168.1.3
export HUE_HOST
lights="4"

status=$(curl --silent https://status.github.com/api/status.json | grep status | egrep -o '(good|minor|major)')
case "$status" in
good)  /bin/bash hue_set_ok.sh     $lights ;;
minor) /bin/bash hue_set_orange.sh $lights ;;
major) /bin/bash hue_set_error.sh  $lights ;;
*)     /bin/bash hue_set_other.sh  $lights ;;
esac

$ cat hue_set_ok.sh

#!/bin/bash

HOST=${HUE_HOST:-192.168.1.3}
USER=${HUE_USER:-beautifulhuetest}

for n in $@
do
    curl -X PUT http://$HOST/api/$USER/lights/$n/state --data '{"bri":60,"hue":25500,"sat":254,"alert":"none","effect":"none"}'
done

Next Step

Replace the simplistic polling implementation by monitoring our Slack channel for Jenkins messages.

References