Admin/isatest-makedist
author nipkow
Wed Aug 04 11:25:08 2004 +0200 (2004-08-04)
changeset 15106 e8cef6993701
parent 14981 e73f8140af78
child 15438 dfc7d2a824d6
permissions -rwxr-xr-x
aded comment
     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 
     8 # source bashrc, we're called by cron
     9 . ~/.bashrc
    10 
    11 # canoncical home for all platforms
    12 HOME=/usr/stud/isatest
    13 
    14 ## global settings
    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"
    16 
    17 TMP=/tmp/isatest-makedist.$$
    18 MAIL=$HOME/bin/pmail
    19 
    20 LOGPREFIX=$HOME/log
    21 MASTERLOG=$LOGPREFIX/isatest.log
    22 ERRORDIR=$HOME/var
    23 ERRORLOG=$ERRORDIR/error.log
    24 RUNNING=$HOME/var/running
    25 DISTPREFIX=$HOME/isadist
    26 MAKEDIST=$HOME/bin/makedist
    27 MAKEALL=$HOME/bin/isatest-makeall
    28 TAR=gtar
    29 
    30 SSH="ssh -f"
    31 
    32 ## diagnostics
    33 
    34 PRG="$(basename "$0")"
    35 
    36 function usage()
    37 {
    38   echo
    39   echo "Usage: $PRG"
    40   echo
    41   echo "   Build distribution and run isatest-make for lots of platforms."
    42   echo
    43   exit 1
    44 }
    45 
    46 function fail()
    47 {
    48   echo "$1" >&2
    49   exit 2
    50 }
    51 
    52 ## main
    53 
    54 # cleanup old error log and test-still-running files
    55 rm -f $ERRORLOG
    56 rm -f $ERRORDIR/isatest-*.log
    57 rm -f $RUNNING/*.runnning
    58 
    59 export DISTPREFIX
    60 
    61 DATE=$(date "+%Y-%m-%d")
    62 DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
    63 
    64 echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
    65 
    66 echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
    67 rm -rf $DISTPREFIX >> $DISTLOG 2>&1
    68 
    69 echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
    70 rm -rf $HOME/isabelle-*
    71 
    72 echo "### building distribution"  >> $DISTLOG 2>&1
    73 $MAKEDIST - >> $DISTLOG 2>&1
    74 
    75 if [ $? -ne 0 ]
    76 then
    77     echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    78     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    79     echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
    80 
    81     echo "Could not build isabelle distribution. Log file available at" > $TMP
    82     echo "$HOSTNAME:$DISTLOG" >> $TMP
    83 
    84     for R in $MAILTO; do
    85         $MAIL "isabelle dist build failed" $R $TMP
    86     done
    87 
    88     rm $TMP
    89 
    90     exit 1
    91 fi
    92 
    93 cd $DISTPREFIX >> $DISTLOG 2>&1
    94 $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
    95 
    96 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    97 gzip -f $DISTLOG
    98 
    99 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
   100 echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
   101 
   102 
   103 ## spawn test runs
   104 
   105 $SSH sunbroy2 "$MAKEALL $DISTPREFIX $HOME/settings/sun-poly $HOME/settings/sun-sml"
   106 # give test some time to copy settings and start
   107 sleep 5
   108 $SSH atbroy51 "$MAKEALL $DISTPREFIX $HOME/settings/at-poly $HOME/settings/at-sml"
   109 # give test some time to copy settings and start
   110 sleep 5
   111 $SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly"
   112 
   113 ## end