Admin/isatest-makedist
author isatest
Mon Jun 24 16:33:43 2002 +0200 (2002-06-24)
changeset 13246 e51efc2029e9
parent 13237 493d61afa731
child 13359 982827aacb39
permissions -rwxr-xr-x
email sending
kleing@13231
     1
#!/usr/bin/env bash
kleing@13231
     2
#
kleing@13231
     3
# $Id$
kleing@13231
     4
# Author: Gerwin Klein, TU Muenchen
kleing@13231
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
kleing@13231
     6
#
kleing@13231
     7
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
kleing@13231
     8
isatest@13237
     9
# source bashrc, we're called by cron
isatest@13237
    10
. ~/.bashrc
isatest@13237
    11
isatest@13237
    12
kleing@13231
    13
## global settings
isatest@13246
    14
MAILTO="kleing@in.tum.de test@jflex.de"
isatest@13246
    15
kleing@13233
    16
LOGPREFIX=~/log
isatest@13237
    17
MASTERLOG=$LOGPREFIX/isatest.log
kleing@13231
    18
DISTPREFIX=~/isadist
kleing@13231
    19
MAKEDIST=~/bin/makedist
isatest@13234
    20
MAKEALL=~/bin/isatest-makeall
isatest@13234
    21
TAR=gtar
kleing@13231
    22
kleing@13231
    23
SUN=sunbroy2
kleing@13231
    24
AT=atbroy37
kleing@13231
    25
kleing@13233
    26
SSH="ssh -f"
kleing@13231
    27
kleing@13231
    28
## diagnostics
kleing@13231
    29
kleing@13231
    30
PRG="$(basename "$0")"
kleing@13231
    31
kleing@13231
    32
function usage()
kleing@13231
    33
{
kleing@13231
    34
  echo
kleing@13231
    35
  echo "Usage: $PRG"
kleing@13231
    36
  echo
kleing@13231
    37
  echo "   Build distribution and run isatest-make for lots of platforms."
kleing@13231
    38
  echo
kleing@13231
    39
  exit 1
kleing@13231
    40
}
kleing@13231
    41
kleing@13231
    42
function fail()
kleing@13231
    43
{
kleing@13231
    44
  echo "$1" >&2
kleing@13231
    45
  exit 2
kleing@13231
    46
}
kleing@13231
    47
kleing@13231
    48
## main
kleing@13231
    49
kleing@13231
    50
export DISTPREFIX
kleing@13231
    51
kleing@13231
    52
DATE=$(date "+%d-%b-%Y")
kleing@13231
    53
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
kleing@13231
    54
kleing@13231
    55
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
kleing@13231
    56
kleing@13231
    57
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
kleing@13231
    58
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
kleing@13231
    59
isatest@13237
    60
echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
isatest@13237
    61
rm -rf ~/isabelle-*
isatest@13237
    62
kleing@13231
    63
echo "### building distribution"  >> $DISTLOG 2>&1
kleing@13231
    64
$MAKEDIST - >> $DISTLOG 2>&1
kleing@13231
    65
kleing@13231
    66
if [ $? -ne 0 ]
kleing@13231
    67
then
kleing@13231
    68
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
isatest@13237
    69
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
isatest@13237
    70
    echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
isatest@13246
    71
isatest@13246
    72
    for R in $MAILTO; do 
isatest@13246
    73
        mail -t $R <<EOM
isatest@13246
    74
Subject: isabelle dist build failed
isatest@13246
    75
isatest@13246
    76
Could not build isabelle distribution. Log file available at
isatest@13246
    77
isatest@13246
    78
$HOSTNAME:$DISTLOG
isatest@13246
    79
EOM
isatest@13246
    80
    done
isatest@13246
    81
kleing@13231
    82
    # more action here
kleing@13231
    83
    exit 1
kleing@13231
    84
fi
kleing@13231
    85
kleing@13231
    86
cd $DISTPREFIX >> $DISTLOG 2>&1
isatest@13234
    87
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
kleing@13231
    88
kleing@13231
    89
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
isatest@13237
    90
gzip -f $DISTLOG
isatest@13237
    91
isatest@13237
    92
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
isatest@13237
    93
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
isatest@13237
    94
kleing@13231
    95
kleing@13231
    96
## spawn test runs
kleing@13231
    97
kleing@13231
    98
# run tests in parallel on multiprocessor sun 
isatest@13246
    99
$SSH $SUN "$MAKEALL $DISTPREFIX ~/settings/sun-poly ~/settings/sun-sml"
isatest@13246
   100
# $SSH $SUN "$MAKEALL $DISTPREFIX ~/settings/sun-sml"
kleing@13231
   101
kleing@13231
   102
# run tests sequentially on x86
isatest@13234
   103
$SSH $AT "$MAKEALL $DISTPREFIX ~/settings/at-poly ~/settings/at-sml"
kleing@13231
   104
isatest@13234
   105
## end