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