Lightweight continuous integration

For my diploma thesis, I use a simple continuous integration system. It doesn't keep logs except mailing me, but it works fine for the simple one-person setup I have. :-)

Wer baggert da so spät noch am Baggerloch?
Wer baggert da so spät noch am Baggerloch?

Advantages:

How to do it:

00,15,30,45 * * * *     cd /home/guenther/continuous_build/ && sh continuous_integration.sh
(Note that crontab automatically sends the script's output to the user via email.)

Web-based build status indicator
Web-based build status indicator

Update: I just couldn't resist to hack this together as well: Have a look at the new build status indicator on my diploma thesis homepage. [edit 2013: The indicator is dysfunctional now, but it worked like a charm; you have to take my word for it :)]

Here's the source code for continuous_integration.sh:

#!/bin/sh
# Run from same directory!

# JSR 308
export JSR308=`pwd`/jsr308

echo "================================="
echo "  Configuration"
echo "================================="
echo "JSR308   : $JSR308"
echo "JAVA_HOME: $JAVA_HOME"
echo "PATH     : $PATH"

echo "================================="
echo "  SVN Update"
echo "================================="
svn up

cd jsr308/checkers

echo "================================="
echo "  Clean"
echo "================================="
ant clean

echo "================================="
echo "  Build"
echo "================================="

if ant all-tests; then
    echo "WIN"
    DISPLAY=":0.0" xsetroot -solid black
else
    echo "FAIL"
    DISPLAY=":0.0" xsetroot -solid red
    killall rhythmbox
    mplayer -really-quiet /usr/share/sounds/ubuntu/stereo/dialog-error.ogg > /dev/null 2> /dev/null
fi

Insert whatever it needs to draw your attention in the "fail" block. :-)

Footnotes

1. I regularly fall for this one. Eclipse doesn't check it, and sometimes I just forget to hit Ctrl-Shift-O after cleaning up.