keskiviikko 20. huhtikuuta 2011

"Build borken!!!" - Adding voice to your build radiator

As in any good ContinuousIntegration obedient team we have a web page showing our current build status. Anyone lurking in our team space sees the build state all the time from a monitor. Additionally if there is a failing build an email is sent to everyone.

Unfortunately the build takes a long time to finish so the state changes are rare and people receive lots of emails so a broken build is often not noticed for a long time (my long time means more than a few minutes).

To cure this we added voice to our radiator: if the state of the build changes it tells it verbally. As we were not able to change the build system or the radiator we did it by an external ruby script.

Main ingredients of the script:
  • The ruby http-uri open("url").read returns the radiator web page as html string
  • The ruby string.scan(/regex/) can be used to look for the build status from the page
  • http://www.rubular.com/ helps to figure out the needed regexp<(li>
  • "echo something | espeak" in Ubuntu Linux and "say something" in mac os x says something :)


With these it took around one hour to brew in the needed ruby script. Now whenever our build state changes we really notice it! Here is our script as an inspiration to anyone interested (if the regexp looks bad no worries as it was easy to come up with by trial and error using Rubular).
A window shutter in Garmisch-Partenkirchen, Germany

Ei kommentteja:

Lähetä kommentti