Admin/isatest/isatest-makedist
author wenzelm
Tue Aug 14 10:44:03 2012 +0200 (2012-08-14)
changeset 48790 6e739225dd8a
parent 48635 bfce940c6f38
child 48832 ab9663b8734b
permissions -rwxr-xr-x
always retain doc-src (as regular component);
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
wenzelm@48259
    19
kleing@22410
    20
## diagnostics
kleing@22410
    21
kleing@22410
    22
PRG="$(basename "$0")"
kleing@22410
    23
kleing@22410
    24
function usage()
kleing@22410
    25
{
kleing@22410
    26
  echo
kleing@22410
    27
  echo "Usage: $PRG"
kleing@22410
    28
  echo
kleing@22410
    29
  echo "   Build distribution and run isatest-make for lots of platforms."
kleing@22410
    30
  echo
kleing@22410
    31
  exit 1
kleing@22410
    32
}
kleing@22410
    33
kleing@22410
    34
function fail()
kleing@22410
    35
{
kleing@22410
    36
  echo "$1" >&2
kleing@22410
    37
  exit 2
kleing@22410
    38
}
kleing@22410
    39
wenzelm@48259
    40
kleing@22410
    41
## main
kleing@22410
    42
kleing@22410
    43
# cleanup old error log and test-still-running files
kleing@22410
    44
rm -f $ERRORLOG
kleing@22410
    45
rm -f $ERRORDIR/isatest-*.log
kleing@22410
    46
rm -f $RUNNING/*.runnning
kleing@22410
    47
kleing@22410
    48
export DISTPREFIX
kleing@22410
    49
kleing@22410
    50
DATE=$(date "+%Y-%m-%d")
kleing@22410
    51
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
kleing@22410
    52
kleing@22410
    53
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
kleing@22410
    54
kleing@22410
    55
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
kleing@22410
    56
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
kleing@22410
    57
kleing@22410
    58
echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
kleing@22410
    59
rm -rf $HOME/isabelle-*
gerwin@48210
    60
kleing@22410
    61
echo "### building distribution"  >> $DISTLOG 2>&1
kleing@22410
    62
mkdir -p $DISTPREFIX
wenzelm@48790
    63
$MAKEDIST -j "/home/isabelle/contrib_devel/jedit_build-20120414" >> $DISTLOG 2>&1
kleing@22410
    64
kleing@22410
    65
if [ $? -ne 0 ]
kleing@22410
    66
then
kleing@22410
    67
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
    68
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
kleing@28539
    69
    log "dist build FAILED, elapsed time $ELAPSED."
kleing@22410
    70
kleing@22410
    71
    echo "Could not build isabelle distribution. Log file available at" > $TMP
kleing@22410
    72
    echo "$HOSTNAME:$DISTLOG" >> $TMP
kleing@22410
    73
kleing@22410
    74
    for R in $MAILTO; do
kleing@22410
    75
        $MAIL "isabelle dist build failed" $R $TMP
kleing@22410
    76
    done
kleing@22410
    77
kleing@22410
    78
    rm $TMP
kleing@22410
    79
kleing@22410
    80
    exit 1
kleing@22410
    81
fi
kleing@22410
    82
kleing@22410
    83
cd $DISTPREFIX >> $DISTLOG 2>&1
wenzelm@40739
    84
ISABELLE_DIST=`cat $DISTPREFIX/ISABELLE_DIST`
wenzelm@40739
    85
$TAR xvzf $ISABELLE_DIST >> $DISTLOG 2>&1
wenzelm@40739
    86
ln -sf $(basename $ISABELLE_DIST .tar.gz) Isabelle
wenzelm@41967
    87
cp Isabelle/etc/settings Isabelle/etc/settings.orig
kleing@22410
    88
kleing@22410
    89
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
    90
kleing@22410
    91
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
kleing@28539
    92
log "dist build successful, elapsed time $ELAPSED."
kleing@22410
    93
wenzelm@48259
    94
kleing@22413
    95
## clean up var/running
kleing@22413
    96
rm -f $RUNNING/*
gerwin@48211
    97
mkdir -p $RUNNING
kleing@22410
    98
wenzelm@48259
    99
kleing@22410
   100
## spawn test runs
kleing@22410
   101
wenzelm@48259
   102
$SSH lxbroy2 "
wenzelm@48259
   103
  $MAKEALL $HOME/settings/at-poly;
wenzelm@48259
   104
  $MAKEALL $HOME/settings/at-poly-test"
wenzelm@35398
   105
sleep 15
wenzelm@48259
   106
$SSH lxbroy3 "
wenzelm@48259
   107
  $MAKEALL $HOME/settings/at64-poly;
wenzelm@48608
   108
  $MAKEALL -l HOL-Library $HOME/settings/at-sml-dev-e"
kleing@28598
   109
sleep 15
wenzelm@48209
   110
$SSH macbroy23 "$MAKEALL $HOME/settings/at-poly-e"
kleing@28598
   111
sleep 15
wenzelm@46004
   112
$SSH macbroy2 "
wenzelm@48635
   113
  $MAKEALL $HOME/settings/mac-poly64-M4;
wenzelm@48635
   114
  $MAKEALL $HOME/settings/mac-poly64-M8;
wenzelm@46004
   115
  $MAKEALL $HOME/settings/mac-poly-M4;
wenzelm@46004
   116
  $MAKEALL $HOME/settings/mac-poly-M8"
wenzelm@31581
   117
sleep 15
wenzelm@44978
   118
$SSH macbroy6 "$MAKEALL $HOME/settings/mac-poly64-M2"
wenzelm@44978
   119
sleep 15
wenzelm@42423
   120
$SSH macbroy30 "sleep 10800; $MAKEALL $HOME/settings/mac-poly-M2"
gerwin@48210
   121
kleing@22410
   122
echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
   123
kleing@22410
   124
gzip -f $DISTLOG
kleing@22410
   125