Skip to content

www.rolfje.com

Make your buildserver talk

Posted on 2012-12-16 By rolfje No Comments on Make your buildserver talk

Jenkins talkingHave you ever started a shell script which takes a while and you keep monitoring that window because you really need those results? If you are working on a Mac, you can use the Mac’s power of speech to tell you a command is finished. Here’s how:

./yourreallyslowbuild.sh; say "really long build is finished"

With a little curl and shell scripting magic, I told my Mac to constantly monitor our Jenkins buildserver, and bug everybody in the office when the hourly build is failing:

#!/bin/sh

# Configuration
jenkinsurl=http://my.jenkins.server/jenkins
voice=Vicki

# The function that does the trick
fnReportFailure() {
  job=${1}
  message=${2}
  result=`curl -s \
    ${jenkinsurl}/job/${job}/lastBuild/api/xml?xpath=/*/result/text()`

  if  [ "${result}" == "XPath /*/result didn't match" ] \
   || [ "${result}" == "ABORTED" ]; then
    # ignore aborted or in-progress build. Ignore.
    return 0
  elif [ "${result}" != "SUCCESS" ]; then
    echo `date` ${job} : ${result}
    say -v "${voice}" "${message}"
  fi
}

# Loop over all projects and shout out problems
clear
echo
echo "Monitoring ${jenkinsurl}"
echo
printf "===== "

while [ true ]; do
  # Add as many jobs as you want here:
  fnReportFailure "hourly_java_job" "The hourly java job is unstable."
  fnReportFailure "hourly_deploy_job" "The hourly deploy failed."

  # Tell the time and sleep a little
  now=`date +%H:%M:%S`
  printf "\b\b\b\b\b\b\b\b\b${now} "
  sleep 60
done

This script talks with the “Vicky” voice, because I let “Alex” read my iChat messages to me. Of course, the “Bad News” and “Zarvox” voices may be even more “motivating” to quickly fix the build. Now go and keep your eyes on youtube… err I mean your code.

Enjoy.

Apple, Fun, Software Tags:programming, usability

Post navigation

Previous Post: The world is not a Green Field
Next Post: Why you should not use SOAP Headers

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

         
@rolfje.com
www.youtube.com/watch?v=ycGh...
17 hours ago
@rolfje.com
Vandaag gaat #degrootstekerstboom aan! www.degrootstekerstboom.nl
19 hours ago
Reposted by @rolfje.com
@shadowmakersdr.bsky.social
Ik ben blij dat de overheid zo consequent is in z'n campagnes. Iedereen fulltime werken, maar wel buiten de spits naar je werk en gebruik de stroom van je zonnepanelen overdag (als je niet thuis bent want op je werk) terwijl je mantelzorgt èn fsyieke winkels bezoekt om 'de winkelstraat' te redden.
3 days ago

Recent Comments

  • Monica Hall on Het belastinghuiswerk nagekeken
  • rolfje on Spring SystemPropertyInitializingBean
  • plinko idle clicker on Spring SystemPropertyInitializingBean
  • rolfje on The podcast problem (fixed)
  • SirenMix on The podcast problem (fixed)

Tags

Anonimatron Apple backup design DIY DRM eclipse environment fix Fun gmail google hacking hamradio Hardware helicopter iphone ipod iTunes Java Kawasaki Keynote linux modelling motorcycle music news opinion oracle osx photo photography programming repair review security Software technology Time Machine Ubuntu usability Utilities vacation windows Workshop

Categories

  • Apple (107)
  • Divorce (1)
  • Electronics (5)
  • Fun (58)
  • Games (8)
  • Hardware (74)
  • Microsoft (18)
  • Racing (16)
  • Software (144)
  • Uncategorized (69)
  • Workshop (23)

Archives

Brought to you without adds, banners, cookies or tracking. This one is on me. Yes, life can be this good. Pay it forward.
AI policy - Privacy policy

Copyright © 2026 www.rolfje.com.

Powered by PressBook WordPress theme