Admin/isatest/isatest-makedist
author wenzelm
Fri Apr 02 17:20:43 2010 +0200 (2010-04-02)
changeset 36074 6301046146b6
parent 35930 7084141f2a93
child 36100 a8912920ef4f
permissions -rwxr-xr-x
isatest: basic setup for cygwin-poly on atbroy102;
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Gerwin Klein, TU Muenchen
     4 #
     5 # DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
     6 
     7 ## global settings
     8 . ~/admin/isatest/isatest-settings
     9 
    10 TMP=/tmp/isatest-makedist.$$
    11 MAIL=$HOME/bin/pmail
    12 
    13 MAKEDIST=$HOME/bin/makedist
    14 MAKEALL=$HOME/bin/isatest-makeall
    15 TAR=tar
    16 
    17 SSH="ssh -f"
    18 
    19 ## diagnostics
    20 
    21 PRG="$(basename "$0")"
    22 
    23 function usage()
    24 {
    25   echo
    26   echo "Usage: $PRG"
    27   echo
    28   echo "   Build distribution and run isatest-make for lots of platforms."
    29   echo
    30   exit 1
    31 }
    32 
    33 function fail()
    34 {
    35   echo "$1" >&2
    36   exit 2
    37 }
    38 
    39 ## main
    40 
    41 # cleanup old error log and test-still-running files
    42 rm -f $ERRORLOG
    43 rm -f $ERRORDIR/isatest-*.log
    44 rm -f $RUNNING/*.runnning
    45 
    46 export DISTPREFIX
    47 
    48 DATE=$(date "+%Y-%m-%d")
    49 DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
    50 
    51 echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
    52 
    53 echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
    54 rm -rf $DISTPREFIX >> $DISTLOG 2>&1
    55 
    56 echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
    57 rm -rf $HOME/isabelle-*
    58 
    59 echo "### building distribution"  >> $DISTLOG 2>&1
    60 mkdir -p $DISTPREFIX
    61 $MAKEDIST >> $DISTLOG 2>&1
    62 
    63 if [ $? -ne 0 ]
    64 then
    65     echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    66     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    67     log "dist build FAILED, elapsed time $ELAPSED."
    68 
    69     echo "Could not build isabelle distribution. Log file available at" > $TMP
    70     echo "$HOSTNAME:$DISTLOG" >> $TMP
    71 
    72     for R in $MAILTO; do
    73         $MAIL "isabelle dist build failed" $R $TMP
    74     done
    75 
    76     rm $TMP
    77 
    78     exit 1
    79 fi
    80 
    81 cd $DISTPREFIX >> $DISTLOG 2>&1
    82 $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
    83 
    84 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    85 
    86 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    87 log "dist build successful, elapsed time $ELAPSED."
    88 
    89 ## clean up var/running
    90 rm -f $RUNNING/*
    91 
    92 ## spawn test runs
    93 
    94 $SSH macbroy21 "$MAKEALL $HOME/settings/at-poly-test"
    95 # give test some time to copy settings and start
    96 sleep 15
    97 $SSH macbroy22 "$MAKEALL $HOME/settings/at-poly"
    98 sleep 15
    99 $SSH macbroy23 "$MAKEALL -l HOL HOL-Library $HOME/settings/at-sml-dev-e"
   100 sleep 15
   101 $SSH macbroy24 "$MAKEALL $HOME/settings/at64-poly"
   102 sleep 15
   103 $SSH macbroy2 "$MAKEALL $HOME/settings/mac-poly64-M4; $MAKEALL $HOME/settings/mac-poly64-M8; $MAKEALL $HOME/settings/mac-poly-M4; $MAKEALL $HOME/settings/mac-poly-M8"
   104 sleep 15
   105 $SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly"
   106 sleep 15
   107 $SSH macbroy6 "sleep 10800; $MAKEALL $HOME/settings/at-mac-poly-5.1-para"
   108 sleep 15
   109 $SSH atbroy102 "mount -a; $MAKEALL $HOME/settings/cygwin-poly"
   110 #sleep 15
   111 #$SSH atbroy51 "$HOME/admin/isatest/isatest-annomaly"
   112 #sleep 15
   113 #$SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly"
   114 
   115 echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
   116 
   117 gzip -f $DISTLOG
   118 
   119 ## end