Admin/isatest-makedist
author wenzelm
Fri Feb 03 23:12:28 2006 +0100 (2006-02-03 ago)
changeset 18921 f47c46d7d654
parent 18889 da6e27ee69e5
child 20019 283dfd5bd36b
permissions -rwxr-xr-x
canonical member/insert/merge;
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@13231
    63
$MAKEDIST - >> $DISTLOG 2>&1
kleing@13231
    64
kleing@13231
    65
if [ $? -ne 0 ]
kleing@13231
    66
then
kleing@13231
    67
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
isatest@13237
    68
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
isatest@13237
    69
    echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
isatest@13246
    70
isatest@13359
    71
    echo "Could not build isabelle distribution. Log file available at" > $TMP
isatest@13359
    72
    echo "$HOSTNAME:$DISTLOG" >> $TMP
isatest@13246
    73
isatest@13359
    74
    for R in $MAILTO; do
kleing@14037
    75
        $MAIL "isabelle dist build failed" $R $TMP
isatest@13246
    76
    done
isatest@13246
    77
isatest@13359
    78
    rm $TMP
isatest@13359
    79
kleing@13231
    80
    exit 1
kleing@13231
    81
fi
kleing@13231
    82
kleing@13231
    83
cd $DISTPREFIX >> $DISTLOG 2>&1
isatest@13234
    84
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
kleing@13231
    85
kleing@13231
    86
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
isatest@13237
    87
isatest@13237
    88
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
isatest@13237
    89
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
isatest@13237
    90
kleing@13231
    91
kleing@13231
    92
## spawn test runs
kleing@13231
    93
kleing@16095
    94
$SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly $HOME/settings/sun-sml-dev"
kleing@14032
    95
# give test some time to copy settings and start
kleing@14032
    96
sleep 5
kleing@16095
    97
$SSH atbroy51 "$MAKEALL $HOME/settings/at-poly $HOME/settings/at-sml-dev"
kleing@14032
    98
sleep 5
kleing@18889
    99
$SSH atbroy98 "$MAKEALL $HOME/settings/at64-poly"
kleing@18889
   100
sleep 5
kleing@16618
   101
$SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly $HOME/settings/mac-sml-dev"
kleing@16095
   102
kleing@16095
   103
kleing@16095
   104
echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@16095
   105
kleing@16095
   106
gzip -f $DISTLOG
kleing@13231
   107
isatest@13234
   108
## end