Admin/isatest-makedist
author kleing
Mon May 05 15:55:56 2003 +0200 (2003-05-05)
changeset 13955 8ab1d3e73bb1
parent 13900 0cfdeb44621e
child 13962 908f6776a59b
permissions -rwxr-xr-x
add mac test
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@13680
    14
MAILTO="kleing@in.tum.de nipkow@in.tum.de berghofe@in.tum.de schirmer@in.tum.de lp15@cam.ac.uk"
isatest@13359
    15
isatest@13359
    16
TMP=/tmp/isatest-makedist.$$
isatest@13359
    17
MAIL=~/bin/pmail
isatest@13246
    18
kleing@13233
    19
LOGPREFIX=~/log
isatest@13237
    20
MASTERLOG=$LOGPREFIX/isatest.log
kleing@13231
    21
DISTPREFIX=~/isadist
kleing@13231
    22
MAKEDIST=~/bin/makedist
isatest@13234
    23
MAKEALL=~/bin/isatest-makeall
isatest@13234
    24
TAR=gtar
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
isatest@13431
    52
DATE=$(date "+%Y-%m-%d")
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@13359
    72
    echo "Could not build isabelle distribution. Log file available at" > $TMP
isatest@13359
    73
    echo "$HOSTNAME:$DISTLOG" >> $TMP
isatest@13246
    74
isatest@13359
    75
    for R in $MAILTO; do
isatest@13359
    76
	$MAIL "isabelle dist build failed" $R $TMP
isatest@13246
    77
    done
isatest@13246
    78
isatest@13359
    79
    rm $TMP
isatest@13359
    80
kleing@13231
    81
    exit 1
kleing@13231
    82
fi
kleing@13231
    83
kleing@13231
    84
cd $DISTPREFIX >> $DISTLOG 2>&1
isatest@13234
    85
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
kleing@13231
    86
isatest@13839
    87
echo "### generating development snapshot web page" >> $DISTLOG 2>&1
isatest@13839
    88
(cd ~/devel-page; make)
isatest@13839
    89
kleing@13231
    90
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
isatest@13237
    91
gzip -f $DISTLOG
isatest@13237
    92
isatest@13237
    93
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
isatest@13237
    94
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
isatest@13237
    95
kleing@13231
    96
kleing@13231
    97
## spawn test runs
kleing@13231
    98
kleing@13955
    99
$SSH sunbroy2 "$MAKEALL $DISTPREFIX ~/settings/sun-poly ~/settings/sun-sml"
kleing@13955
   100
$SSH atbroy51 "$MAKEALL $DISTPREFIX ~/settings/at-poly ~/settings/at-sml"
kleing@13955
   101
$SSH macbroy33 "$MAKEALL $DISTPREFIX ~/settings/mac-poly"
kleing@13231
   102
isatest@13234
   103
## end