Demo of a Perl script to check if any Jenkins builds are broken and raise some alarms
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
flagit.cpp
jenkins_alarm.pl
play_imperial_march.sh
play_star_wars_theme.sh

README.md

Jenkins Alarm Demo

Demo of a simple script that checks if any Jenkins build is broken. If it is, the script raises a physical flag, plays some beep music, and sends some text to be spoken aloud from an Android device.

Full explanation in this blog post: Make your workplace more fun with a Jenkins alarm system

Developers

License

WTFPL, although attribution would be nice.

Prerequesites

For the flag, you'll need a Yoctopuce Yocto-Servo setup.

For "beep" to work, you'll probably have to do the following (assuming a Debian/Ubuntu machine):

sudo modprobe pcspkr        # enable pc speaker
sudo apt-get install beep   # install beep
alsamixer                   # adjust beep volume

For the Android-powered text-to-speech, you'll need my SimpleTalker app, the Android SDK, and an Android device attached via USB.

Usage

jenkins_alarm.pl is the main script that should be called in a crontab, probably every 5 minutes or so, e.g.

*/5 * * * * /my/path/to/jenkins_alarm.pl

flagit.cpp is a C++ program that uses the Yoctopuce API to set the angle on the servo. You should compile it into an executable called flagit.

The executable takes two arguments: 1) the servo we're calling (numbered 1-5), and 2) the angle to set (between -1000 and 1000), e.g.

flagit 1 -1000

sets the 1st connected servo to the lowest position.

play_imperial_march.sh plays DUH DUH DUH, DUH da DUH, DUH da DUH.

play_star_wars_theme.sh plays DUUUH DUH dadada DUUUH DUH, dadada DUUUH DUH, dadada DUUUH.