Mercurial > dottes
comparison makeWebItems.sh @ 48:6f4667d1372d
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.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Sun, 04 Mar 2012 16:09:06 +0000 |
parents | d92717f8130c |
children | 3464d5154f49 |
comparison
equal
deleted
inserted
replaced
47:23cbad0faa52 | 48:6f4667d1372d |
---|---|
15 builddir=$dir/web/$1 | 15 builddir=$dir/web/$1 |
16 graphicsdir=$dir/graphics/$1 | 16 graphicsdir=$dir/graphics/$1 |
17 | 17 |
18 mkdir -p $builddir | 18 mkdir -p $builddir |
19 | 19 |
20 # Now, for each tune, make the tune JPG and sound. | 20 # Now, for each tune, make the tune JPG and sound. Do this to temp |
21 # files and rename into place to make updates as atomic as possible. | |
21 find $booke -name "*.abc" | sort | | 22 find $booke -name "*.abc" | sort | |
22 while read filename | 23 while read filename |
23 do | 24 do |
24 name=`basename $filename .abc` | 25 name=`basename $filename .abc` |
25 convert $graphicsdir/${name}.eps $builddir/${name}.jpg | 26 convert $graphicsdir/${name}.eps $builddir/${name}.jpg.tmp |
26 | 27 |
27 abc2midi $filename -o $builddir/${name}.mid | 28 abc2midi $filename -o $builddir/${name}.mid.tmp |
28 timidity -Ow -o $builddir/${name}.wav $builddir/${name}.mid | 29 timidity -Ow -o $builddir/${name}.wav.tmp $builddir/${name}.mid.tmp |
29 lame --quiet $builddir/${name}.wav $builddir/${name}.mp3 | 30 lame --quiet $builddir/${name}.wav.tmp $builddir/${name}.mp3.tmp |
30 rm $builddir/${name}.wav | 31 |
32 mv $builddir/${name}.jpg.tmp $builddir/${name}.jpg | |
33 mv $builddir/${name}.mid.tmp $builddir/${name}.mid | |
34 mv $builddir/${name}.mp3.tmp $builddir/${name}.mp3 | |
35 rm $builddir/${name}.wav.tmp | |
31 done | 36 done |
32 | 37 |