Admin/isatest/isatest-makedist
author wenzelm
Sat Dec 17 16:24:14 2011 +0100 (2011-12-17)
changeset 45913 7f7c3922c636
parent 45149 22ff7e226946
child 46004 484ef66bc3a1
permissions -rwxr-xr-x
updated jedit_build 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
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@36242
    58
ssh atbroy102 "rm -rf /home/isatest/isabelle-cygwin-poly-e"
kleing@22410
    59
kleing@22410
    60
echo "### building distribution"  >> $DISTLOG 2>&1
kleing@22410
    61
mkdir -p $DISTPREFIX
wenzelm@45913
    62
$MAKEDIST -j "/home/isabelle/contrib_devel/jedit_build-20111217" >> $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
wenzelm@40739
    83
ISABELLE_DIST=`cat $DISTPREFIX/ISABELLE_DIST`
wenzelm@40739
    84
$TAR xvzf $ISABELLE_DIST >> $DISTLOG 2>&1
wenzelm@40739
    85
ln -sf $(basename $ISABELLE_DIST .tar.gz) Isabelle
wenzelm@41967
    86
cp Isabelle/etc/settings Isabelle/etc/settings.orig
kleing@22410
    87
wenzelm@36192
    88
ssh atbroy102 "rm -rf /home/isatest/isadist && mkdir -p /home/isatest/isadist" && \
wenzelm@36192
    89
rsync -a "$HOME/isadist/." atbroy102:/home/isatest/isadist/.
wenzelm@36192
    90
kleing@22410
    91
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
    92
kleing@22410
    93
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
kleing@28539
    94
log "dist build successful, elapsed time $ELAPSED."
kleing@22410
    95
kleing@22413
    96
## clean up var/running
kleing@22413
    97
rm -f $RUNNING/*
kleing@22410
    98
kleing@22410
    99
## spawn test runs
kleing@22410
   100
wenzelm@43364
   101
$SSH macbroy21 "$MAKEALL $HOME/settings/at-poly-test"
wenzelm@35398
   102
# give test some time to copy settings and start
wenzelm@35398
   103
sleep 15
wenzelm@45149
   104
$SSH macbroy28 "$MAKEALL $HOME/settings/at-poly; $MAKEALL $HOME/settings/at-poly-e"
kleing@28598
   105
sleep 15
wenzelm@41599
   106
$SSH macbroy22 "$MAKEALL -l HOL HOL-Library $HOME/settings/at-sml-dev-e"
wenzelm@32735
   107
sleep 15
wenzelm@33760
   108
$SSH macbroy24 "$MAKEALL $HOME/settings/at64-poly"
kleing@28598
   109
sleep 15
wenzelm@32854
   110
$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
   111
sleep 15
kleing@27488
   112
$SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly"
kleing@28598
   113
sleep 15
wenzelm@44978
   114
$SSH macbroy6 "$MAKEALL $HOME/settings/mac-poly64-M2"
wenzelm@44978
   115
sleep 15
wenzelm@42423
   116
$SSH macbroy30 "sleep 10800; $MAKEALL $HOME/settings/mac-poly-M2"
wenzelm@36074
   117
sleep 15
wenzelm@36242
   118
$SSH atbroy102 "$MAKEALL $HOME/settings/cygwin-poly-e"
wenzelm@33760
   119
#sleep 15
wenzelm@33760
   120
#$SSH atbroy51 "$HOME/admin/isatest/isatest-annomaly"
kleing@22410
   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
kleing@22410
   126
## end