Admin/isatest-makedist
author isatest
Fri Jun 21 15:41:07 2002 +0200 (2002-06-21)
changeset 13237 493d61afa731
parent 13234 8139edae3bf5
child 13246 e51efc2029e9
permissions -rwxr-xr-x
cleanup old isabelle-* dirs before test start
included master log file
     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 LOGPREFIX=~/log
    15 MASTERLOG=$LOGPREFIX/isatest.log
    16 DISTPREFIX=~/isadist
    17 MAKEDIST=~/bin/makedist
    18 MAKEALL=~/bin/isatest-makeall
    19 TAR=gtar
    20 
    21 SUN=sunbroy2
    22 AT=atbroy37
    23 
    24 SSH="ssh -f"
    25 
    26 ## diagnostics
    27 
    28 PRG="$(basename "$0")"
    29 
    30 function usage()
    31 {
    32   echo
    33   echo "Usage: $PRG"
    34   echo
    35   echo "   Build distribution and run isatest-make for lots of platforms."
    36   echo
    37   exit 1
    38 }
    39 
    40 function fail()
    41 {
    42   echo "$1" >&2
    43   exit 2
    44 }
    45 
    46 ## main
    47 
    48 export DISTPREFIX
    49 
    50 DATE=$(date "+%d-%b-%Y")
    51 DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
    52 
    53 echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
    54 
    55 echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
    56 rm -rf $DISTPREFIX >> $DISTLOG 2>&1
    57 
    58 echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
    59 rm -rf ~/isabelle-*
    60 
    61 echo "### building distribution"  >> $DISTLOG 2>&1
    62 $MAKEDIST - >> $DISTLOG 2>&1
    63 
    64 if [ $? -ne 0 ]
    65 then
    66     echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    67     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    68     echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
    69     # more action here
    70     exit 1
    71 fi
    72 
    73 cd $DISTPREFIX >> $DISTLOG 2>&1
    74 $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
    75 
    76 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    77 gzip -f $DISTLOG
    78 
    79 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    80 echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
    81 
    82 
    83 ## spawn test runs
    84 
    85 # run tests in parallel on multiprocessor sun 
    86 $SSH $SUN "$MAKEALL $DISTPREFIX ~/settings/sun-poly"
    87 $SSH $SUN "$MAKEALL $DISTPREFIX ~/settings/sun-sml"
    88 
    89 # run tests sequentially on x86
    90 $SSH $AT "$MAKEALL $DISTPREFIX ~/settings/at-poly ~/settings/at-sml"
    91 
    92 ## end