| author | paulson | 
| Tue, 22 Mar 2005 16:31:51 +0100 | |
| changeset 15616 | cdf6eeb4ac27 | 
| parent 15438 | dfc7d2a824d6 | 
| child 15806 | 8941300da5a6 | 
| permissions | -rwxr-xr-x | 
| 13231 | 1 | #!/usr/bin/env bash | 
| 2 | # | |
| 3 | # $Id$ | |
| 4 | # Author: Gerwin Klein, TU Muenchen | |
| 5 | # | |
| 6 | # DESCRIPTION: Build distribution and run isatest-make for lots of platforms. | |
| 7 | ||
| 13237 | 8 | # source bashrc, we're called by cron | 
| 9 | . ~/.bashrc | |
| 10 | ||
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 11 | # canoncical home for all platforms | 
| 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 12 | HOME=/usr/stud/isatest | 
| 13237 | 13 | |
| 13231 | 14 | ## global settings | 
| 14170 
edd5a2ea3807
Added skalberg to recepients, changed admin from kleing to berghofe.
 skalberg parents: 
14037diff
changeset | 15 | MAILTO="kleing@in.tum.de nipkow@in.tum.de berghofe@in.tum.de schirmer@in.tum.de lp15@cam.ac.uk skalberg@in.tum.de" | 
| 13359 | 16 | |
| 17 | TMP=/tmp/isatest-makedist.$$ | |
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 18 | MAIL=$HOME/bin/pmail | 
| 13246 | 19 | |
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 20 | LOGPREFIX=$HOME/log | 
| 13237 | 21 | MASTERLOG=$LOGPREFIX/isatest.log | 
| 14037 | 22 | ERRORDIR=$HOME/var | 
| 23 | ERRORLOG=$ERRORDIR/error.log | |
| 13991 | 24 | RUNNING=$HOME/var/running | 
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 25 | DISTPREFIX=$HOME/isadist | 
| 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 26 | MAKEDIST=$HOME/bin/makedist | 
| 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 27 | MAKEALL=$HOME/bin/isatest-makeall | 
| 13234 | 28 | TAR=gtar | 
| 15438 | 29 | CVS2CL=$HOME/bin/cvs2cl | 
| 13231 | 30 | |
| 13233 | 31 | SSH="ssh -f" | 
| 13231 | 32 | |
| 33 | ## diagnostics | |
| 34 | ||
| 35 | PRG="$(basename "$0")" | |
| 36 | ||
| 37 | function usage() | |
| 38 | {
 | |
| 39 | echo | |
| 40 | echo "Usage: $PRG" | |
| 41 | echo | |
| 42 | echo " Build distribution and run isatest-make for lots of platforms." | |
| 43 | echo | |
| 44 | exit 1 | |
| 45 | } | |
| 46 | ||
| 47 | function fail() | |
| 48 | {
 | |
| 49 | echo "$1" >&2 | |
| 50 | exit 2 | |
| 51 | } | |
| 52 | ||
| 53 | ## main | |
| 54 | ||
| 13988 
28c953b54cbe
add cleanup of old error log and test-still-running files
 kleing parents: 
13962diff
changeset | 55 | # cleanup old error log and test-still-running files | 
| 
28c953b54cbe
add cleanup of old error log and test-still-running files
 kleing parents: 
13962diff
changeset | 56 | rm -f $ERRORLOG | 
| 14037 | 57 | rm -f $ERRORDIR/isatest-*.log | 
| 13988 
28c953b54cbe
add cleanup of old error log and test-still-running files
 kleing parents: 
13962diff
changeset | 58 | rm -f $RUNNING/*.runnning | 
| 
28c953b54cbe
add cleanup of old error log and test-still-running files
 kleing parents: 
13962diff
changeset | 59 | |
| 13231 | 60 | export DISTPREFIX | 
| 15438 | 61 | export CVS2CL | 
| 13231 | 62 | |
| 13431 
b0ba3b3573e1
changed date format for proper lexicographical ordering
 isatest parents: 
13359diff
changeset | 63 | DATE=$(date "+%Y-%m-%d") | 
| 13231 | 64 | DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log | 
| 65 | ||
| 66 | echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1 | |
| 67 | ||
| 68 | echo "### cleaning up old dist directory" >> $DISTLOG 2>&1 | |
| 69 | rm -rf $DISTPREFIX >> $DISTLOG 2>&1 | |
| 70 | ||
| 13237 | 71 | echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1 | 
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 72 | rm -rf $HOME/isabelle-* | 
| 13237 | 73 | |
| 13231 | 74 | echo "### building distribution" >> $DISTLOG 2>&1 | 
| 75 | $MAKEDIST - >> $DISTLOG 2>&1 | |
| 76 | ||
| 77 | if [ $? -ne 0 ] | |
| 78 | then | |
| 79 | echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 | |
| 13237 | 80 |     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
 | 
| 81 | echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG | |
| 13246 | 82 | |
| 13359 | 83 | echo "Could not build isabelle distribution. Log file available at" > $TMP | 
| 84 | echo "$HOSTNAME:$DISTLOG" >> $TMP | |
| 13246 | 85 | |
| 13359 | 86 | for R in $MAILTO; do | 
| 14037 | 87 | $MAIL "isabelle dist build failed" $R $TMP | 
| 13246 | 88 | done | 
| 89 | ||
| 13359 | 90 | rm $TMP | 
| 91 | ||
| 13231 | 92 | exit 1 | 
| 93 | fi | |
| 94 | ||
| 95 | cd $DISTPREFIX >> $DISTLOG 2>&1 | |
| 13234 | 96 | $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1 | 
| 13231 | 97 | |
| 98 | echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 | |
| 13237 | 99 | gzip -f $DISTLOG | 
| 100 | ||
| 101 | ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
 | |
| 102 | echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG | |
| 103 | ||
| 13231 | 104 | |
| 105 | ## spawn test runs | |
| 106 | ||
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 107 | $SSH sunbroy2 "$MAKEALL $DISTPREFIX $HOME/settings/sun-poly $HOME/settings/sun-sml" | 
| 14032 | 108 | # give test some time to copy settings and start | 
| 109 | sleep 5 | |
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 110 | $SSH atbroy51 "$MAKEALL $DISTPREFIX $HOME/settings/at-poly $HOME/settings/at-sml" | 
| 14032 | 111 | # give test some time to copy settings and start | 
| 112 | sleep 5 | |
| 13962 
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
 kleing parents: 
13955diff
changeset | 113 | $SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly" | 
| 13231 | 114 | |
| 13234 | 115 | ## end |