Admin/isatest-makedist
author wenzelm
Fri Dec 29 17:24:46 2006 +0100 (2006-12-29)
changeset 21935 4e20a5397b57
parent 21574 659d4509b96f
permissions -rwxr-xr-x
renamed project to subgraph, improved presentation, avoided unnecessary evaluation of predicate;
     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 --follow-only TRUNK"
    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 mkdir -p $DISTPREFIX
    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 ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    88 
    89 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    90 echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
    91 
    92 
    93 ## spawn test runs
    94 
    95 $SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly"
    96 # give test some time to copy settings and start
    97 sleep 5
    98 $SSH atbroy51 "$MAKEALL $HOME/settings/at-poly $HOME/settings/at-poly-e"
    99 sleep 5
   100 $SSH atbroy10 "$MAKEALL $HOME/settings/at-sml-dev"
   101 sleep 5
   102 $SSH atbroy101 "$MAKEALL $HOME/settings/at64-poly-e"
   103 sleep 5
   104 $SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly $HOME/settings/mac-sml-dev"
   105 sleep 5
   106 $SSH macbroy6 "/usr/stud/isatest/bin/isatest-makeall $HOME/settings/at-mac-poly-e"
   107 
   108 echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
   109 
   110 gzip -f $DISTLOG
   111 
   112 ## end