# HG changeset patch # User Jim Hague # Date 1330877346 0 # Node ID 6f4667d1372d64f980d2c94942b58174ff73e51e # Parent 23cbad0faa522b7217499da211e302567d82d3f0 Try to make web item updates atomic-ish. The Jenkins workspace is exported as the web site. So when updating files that take time, such as making MP3, create to a temp file and rename into place. diff -r 23cbad0faa52 -r 6f4667d1372d makeWebItems.sh --- a/makeWebItems.sh Sun Mar 04 16:04:12 2012 +0000 +++ b/makeWebItems.sh Sun Mar 04 16:09:06 2012 +0000 @@ -17,16 +17,21 @@ mkdir -p $builddir -# Now, for each tune, make the tune JPG and sound. +# Now, for each tune, make the tune JPG and sound. Do this to temp +# files and rename into place to make updates as atomic as possible. find $booke -name "*.abc" | sort | while read filename do name=`basename $filename .abc` - convert $graphicsdir/${name}.eps $builddir/${name}.jpg + convert $graphicsdir/${name}.eps $builddir/${name}.jpg.tmp - abc2midi $filename -o $builddir/${name}.mid - timidity -Ow -o $builddir/${name}.wav $builddir/${name}.mid - lame --quiet $builddir/${name}.wav $builddir/${name}.mp3 - rm $builddir/${name}.wav + abc2midi $filename -o $builddir/${name}.mid.tmp + timidity -Ow -o $builddir/${name}.wav.tmp $builddir/${name}.mid.tmp + lame --quiet $builddir/${name}.wav.tmp $builddir/${name}.mp3.tmp + + mv $builddir/${name}.jpg.tmp $builddir/${name}.jpg + mv $builddir/${name}.mid.tmp $builddir/${name}.mid + mv $builddir/${name}.mp3.tmp $builddir/${name}.mp3 + rm $builddir/${name}.wav.tmp done