Admin/isatest-makedist
author haftmann
Tue Sep 19 15:21:42 2006 +0200 (2006-09-19)
changeset 20588 c847c56edf0c
parent 20339 d001121600ac
child 21039 41d61de086bb
permissions -rwxr-xr-x
added operational equality
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
#
kleing@13231
     6
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
kleing@13231
     7
kleing@13231
     8
## global settings
kleing@16095
     9
. ~/admin/isatest-settings
isatest@13359
    10
isatest@13359
    11
TMP=/tmp/isatest-makedist.$$
kleing@13962
    12
MAIL=$HOME/bin/pmail
isatest@13246
    13
kleing@13962
    14
MAKEDIST=$HOME/bin/makedist
kleing@13962
    15
MAKEALL=$HOME/bin/isatest-makeall
isatest@13234
    16
TAR=gtar
isatest@17578
    17
CVS2CL="$HOME/bin/cvs2cl --follow-only TRUNK"
kleing@13231
    18
kleing@13233
    19
SSH="ssh -f"
kleing@13231
    20
kleing@13231
    21
## diagnostics
kleing@13231
    22
kleing@13231
    23
PRG="$(basename "$0")"
kleing@13231
    24
kleing@13231
    25
function usage()
kleing@13231
    26
{
kleing@13231
    27
  echo
kleing@13231
    28
  echo "Usage: $PRG"
kleing@13231
    29
  echo
kleing@13231
    30
  echo "   Build distribution and run isatest-make for lots of platforms."
kleing@13231
    31
  echo
kleing@13231
    32
  exit 1
kleing@13231
    33
}
kleing@13231
    34
kleing@13231
    35
function fail()
kleing@13231
    36
{
kleing@13231
    37
  echo "$1" >&2
kleing@13231
    38
  exit 2
kleing@13231
    39
}
kleing@13231
    40
kleing@13231
    41
## main
kleing@13231
    42
kleing@13988
    43
# cleanup old error log and test-still-running files
kleing@13988
    44
rm -f $ERRORLOG
kleing@14037
    45
rm -f $ERRORDIR/isatest-*.log
kleing@13988
    46
rm -f $RUNNING/*.runnning
kleing@13988
    47
kleing@13231
    48
export DISTPREFIX
berghofe@15438
    49
export CVS2CL
kleing@13231
    50
isatest@13431
    51
DATE=$(date "+%Y-%m-%d")
kleing@13231
    52
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
kleing@13231
    53
kleing@13231
    54
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
kleing@13231
    55
kleing@13231
    56
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
kleing@13231
    57
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
kleing@13231
    58
isatest@13237
    59
echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
kleing@13962
    60
rm -rf $HOME/isabelle-*
isatest@13237
    61
kleing@13231
    62
echo "### building distribution"  >> $DISTLOG 2>&1
kleing@20019
    63
mkdir -p $DISTPREFIX
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
kleing@14037
    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
kleing@13231
    87
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
isatest@13237
    88
isatest@13237
    89
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
isatest@13237
    90
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
isatest@13237
    91
kleing@13231
    92
kleing@13231
    93
## spawn test runs
kleing@13231
    94
kleing@16095
    95
$SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly $HOME/settings/sun-sml-dev"
kleing@14032
    96
# give test some time to copy settings and start
kleing@14032
    97
sleep 5
kleing@16095
    98
$SSH atbroy51 "$MAKEALL $HOME/settings/at-poly $HOME/settings/at-sml-dev"
isatest@20339
    99
#sleep 5
isatest@20339
   100
# $SSH atbroy98 "$MAKEALL $HOME/settings/at64-poly"
kleing@14032
   101
sleep 5
isatest@20339
   102
$SSH atbroy101 "$MAKEALL $HOME/settings/at64-poly2"
kleing@18889
   103
sleep 5
kleing@16618
   104
$SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly $HOME/settings/mac-sml-dev"
kleing@16095
   105
kleing@16095
   106
kleing@16095
   107
echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@16095
   108
kleing@16095
   109
gzip -f $DISTLOG
kleing@13231
   110
isatest@13234
   111
## end