jenkins the definitive guide

(Jeff_L) #1

Figure 8.29. Configuring Jenkins Speaks


The advantage of this approach lies in it’s precision: since you can use Jenkins variables in the Jelly
script, you can get Jenkins to say just about anything you want about the state of the build. Here is a
simple example:


<j:choose>
<j:when test="${build.result!='SUCCESS'}">
Your attention please. Project ${build.project.name} has failed
<j:if test="${build.project.lastBuild.result!='SUCCESS'}"> again</j:if>
</j:when>
<j:otherwise><!-- Say nothing --></j:otherwise>
</j:choose>

If you leave this field blank, the plugin will use a default template that you can configure in the System
Configuration page. In fact, it is usually a good idea to do this, and only to use a project-specific script
if you really need to.


The disadvantage is that the robotic voice can make it a little hard to understand. For this reason, it
is a good idea to start your announcement with a generic phrase such as “Your attention please,” or
to combine it with the Jenkins Sounds plugin, so that you have developers’ attention before the actual
message is broadcast. Using hyphens in your project names (e.g., game-of-life rather then gameoflife)
will also help the plugin know how to pronounce your project names.


Both these approaches are useful for small teams, but can be limited for larger ones, when the server is
not physically located in close proximity to the development team. Future versions may support playing
sounds on a separate machine, but at the time of writing this feature was not available.


8.14. Extreme Feedback Devices


Many more imaginative notification tools and strategies exist, and there is plenty of scope for
improvisation if you are willing to improvise with electronics a little. This includes devices such as
Ambient Orbs, Lava Lamps, traffic lights, or other more exotic USB-controlled devices. The Build
Radiator (see Section 8.6, “Build Radiators”) also falls into this category if you project it onto a big
enough screen.


One device that integrates very nicely with Jenkins is the Nabaztag. The Nabaztag (see Figure 8.30, “A
Nabaztag”) is a popular WiFi-enabled robotic rabbit that can flash colored lights, play music, or even
speak. Once advantage of the Nabaztag is that, since it works via WiFi, it is not constrained to be located

Free download pdf