Figure 8.27. Configuring Jenkins Sounds rules in a build job
To set this up, you need to tick the Jenkins Sounds checkbox in the Post-build Actions section of your
build job configuration page. You can add as many sound configuration rules as you like. Adding a rule
is simple enough. First, you need to choose which build result will trigger the sound. You also need
to specify the previous build results for which this rule is applicable: Not Build (NB), Aborted (Ab),
Failed (Fa), Unsuccessful (Un) or Successful (Su).
The Jenkins Sounds plugin proposes a large list of pre-defined sounds, which usually offer plenty of
choice for even the most discerning build administrator, but you can add your own to the list if you
really want to. Sounds are stored as a ZIP or JAR file containing sound files in a flat directory structure
(i.e., no subdirectories). The list of sounds proposed by the plugin is simply the list of filenames, minus
the extensions. The plugin supports AIFF, AU, and WAV files.
In the System Configuration page, you can give Jenkins a new sound archive file, using the http://
notation if your sound archive file is available on a local web server, or the file:// notation if
it is available locally (see Figure 8.28, “Configuring Jenkins Sounds”). Once you have saved the
configuration, you can test the sounds in your sound archive via the Test Sound button in the Advanced
section.
Figure 8.28. Configuring Jenkins Sounds
The Jenkins Sounds plugin is an excellent choice if you want to complement your more conventional
notification techniques. Short, recognizable sounds are a great way to grab a developer’s attention and
let the team know that something needs fixing. They will then be a bit more receptive when the more
detailed notifications follow.
Another option is the Jenkins Speaks plugin. With this plugin, you can get Jenkins to broadcast a
customized announcement (in a very robotic voice) when your build fails (see Figure 8.29, “Configuring
Jenkins Speaks”). You can configure the exact message using Jelly. Jelly is an XML-based scripting
language used widely in the lower levels of Jenkins.