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