Admin/isatest-makedist
author kleing
Mon May 05 15:55:56 2003 +0200 (2003-05-05)
changeset 13955 8ab1d3e73bb1
parent 13900 0cfdeb44621e
child 13962 908f6776a59b
permissions -rwxr-xr-x
add mac test
     1 #!/usr/bin/env bash
     2 #
     3 # $Id$
     4 # Author: Gerwin Klein, TU Muenchen
     5 # License: GPL (GNU GENERAL PUBLIC LICENSE)
     6 #
     7 # DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
     8 
     9 # source bashrc, we're called by cron
    10 . ~/.bashrc
    11 
    12 
    13 ## global settings
    14 MAILTO="kleing@in.tum.de nipkow@in.tum.de berghofe@in.tum.de schirmer@in.tum.de lp15@cam.ac.uk"
    15 
    16 TMP=/tmp/isatest-makedist.$$
    17 MAIL=~/bin/pmail
    18 
    19 LOGPREFIX=~/log
    20 MASTERLOG=$LOGPREFIX/isatest.log
    21 DISTPREFIX=~/isadist
    22 MAKEDIST=~/bin/makedist
    23 MAKEALL=~/bin/isatest-makeall
    24 TAR=gtar
    25 
    26 SSH="ssh -f"
    27 
    28 ## diagnostics
    29 
    30 PRG="$(basename "$0")"
    31 
    32 function usage()
    33 {
    34   echo
    35   echo "Usage: $PRG"
    36   echo
    37   echo "   Build distribution and run isatest-make for lots of platforms."
    38   echo
    39   exit 1
    40 }
    41 
    42 function fail()
    43 {
    44   echo "$1" >&2
    45   exit 2
    46 }
    47 
    48 ## main
    49 
    50 export DISTPREFIX
    51 
    52 DATE=$(date "+%Y-%m-%d")
    53 DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
    54 
    55 echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
    56 
    57 echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
    58 rm -rf $DISTPREFIX >> $DISTLOG 2>&1
    59 
    60 echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
    61 rm -rf ~/isabelle-*
    62 
    63 echo "### building distribution"  >> $DISTLOG 2>&1
    64 $MAKEDIST - >> $DISTLOG 2>&1
    65 
    66 if [ $? -ne 0 ]
    67 then
    68     echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    69     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    70     echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
    71 
    72     echo "Could not build isabelle distribution. Log file available at" > $TMP
    73     echo "$HOSTNAME:$DISTLOG" >> $TMP
    74 
    75     for R in $MAILTO; do
    76 	$MAIL "isabelle dist build failed" $R $TMP
    77     done
    78 
    79     rm $TMP
    80 
    81     exit 1
    82 fi
    83 
    84 cd $DISTPREFIX >> $DISTLOG 2>&1
    85 $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
    86 
    87 echo "### generating development snapshot web page" >> $DISTLOG 2>&1
    88 (cd ~/devel-page; make)
    89 
    90 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    91 gzip -f $DISTLOG
    92 
    93 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    94 echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
    95 
    96 
    97 ## spawn test runs
    98 
    99 $SSH sunbroy2 "$MAKEALL $DISTPREFIX ~/settings/sun-poly ~/settings/sun-sml"
   100 $SSH atbroy51 "$MAKEALL $DISTPREFIX ~/settings/at-poly ~/settings/at-sml"
   101 $SSH macbroy33 "$MAKEALL $DISTPREFIX ~/settings/mac-poly"
   102 
   103 ## end