Admin/isatest-makedist
author kleing
Fri, 22 Apr 2005 01:38:13 +0200
changeset 15808 cbe7ec0cdeb9
parent 15807 98bff95f88ba
child 15813 741978011e12
permissions -rwxr-xr-x
updated, added Admin/page after-release maintenance
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     1
#!/usr/bin/env bash
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     2
#
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     3
# $Id$
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     4
# Author: Gerwin Klein, TU Muenchen
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     5
#
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     6
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     7
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
     8
# source bashrc, we're called by cron
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
     9
. ~/.bashrc
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    10
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    11
# canoncical home for all platforms
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    12
HOME=/usr/stud/isatest
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    13
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    14
## global settings
14170
edd5a2ea3807 Added skalberg to recepients, changed admin from kleing to berghofe.
skalberg
parents: 14037
diff changeset
    15
MAILTO="kleing@in.tum.de nipkow@in.tum.de berghofe@in.tum.de schirmer@in.tum.de lp15@cam.ac.uk skalberg@in.tum.de"
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    16
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    17
TMP=/tmp/isatest-makedist.$$
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    18
MAIL=$HOME/bin/pmail
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    19
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    20
LOGPREFIX=$HOME/log
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    21
MASTERLOG=$LOGPREFIX/isatest.log
14037
3b7f3eec9684 more cleanup
kleing
parents: 14032
diff changeset
    22
ERRORDIR=$HOME/var
3b7f3eec9684 more cleanup
kleing
parents: 14032
diff changeset
    23
ERRORLOG=$ERRORDIR/error.log
13991
b289ab046d3b var/run -> var/running
kleing
parents: 13988
diff changeset
    24
RUNNING=$HOME/var/running
15806
8941300da5a6 test stable and devel version of smlnj
kleing
parents: 15438
diff changeset
    25
DISTPREFIX=$HOME/tmp/isadist
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    26
MAKEDIST=$HOME/bin/makedist
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    27
MAKEALL=$HOME/bin/isatest-makeall
13234
isatest
parents: 13233
diff changeset
    28
TAR=gtar
15438
dfc7d2a824d6 Added ChangeLog
berghofe
parents: 14981
diff changeset
    29
CVS2CL=$HOME/bin/cvs2cl
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    30
13233
kleing
parents: 13231
diff changeset
    31
SSH="ssh -f"
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    32
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    33
## diagnostics
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    34
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    35
PRG="$(basename "$0")"
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    36
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    37
function usage()
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    38
{
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    39
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    40
  echo "Usage: $PRG"
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    41
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    42
  echo "   Build distribution and run isatest-make for lots of platforms."
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    43
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    44
  exit 1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    45
}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    46
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    47
function fail()
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    48
{
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    49
  echo "$1" >&2
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    50
  exit 2
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    51
}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    52
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    53
## main
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    54
13988
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    55
# cleanup old error log and test-still-running files
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    56
rm -f $ERRORLOG
14037
3b7f3eec9684 more cleanup
kleing
parents: 14032
diff changeset
    57
rm -f $ERRORDIR/isatest-*.log
13988
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    58
rm -f $RUNNING/*.runnning
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    59
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    60
export DISTPREFIX
15438
dfc7d2a824d6 Added ChangeLog
berghofe
parents: 14981
diff changeset
    61
export CVS2CL
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    62
13431
b0ba3b3573e1 changed date format for proper lexicographical ordering
isatest
parents: 13359
diff changeset
    63
DATE=$(date "+%Y-%m-%d")
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    64
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    65
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    66
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    67
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    68
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    69
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    70
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    71
echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    72
rm -rf $HOME/isabelle-*
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    73
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    74
echo "### building distribution"  >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    75
$MAKEDIST - >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    76
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    77
if [ $? -ne 0 ]
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    78
then
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    79
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    80
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    81
    echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    82
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    83
    echo "Could not build isabelle distribution. Log file available at" > $TMP
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    84
    echo "$HOSTNAME:$DISTLOG" >> $TMP
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    85
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    86
    for R in $MAILTO; do
14037
3b7f3eec9684 more cleanup
kleing
parents: 14032
diff changeset
    87
        $MAIL "isabelle dist build failed" $R $TMP
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    88
    done
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    89
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    90
    rm $TMP
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    91
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    92
    exit 1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    93
fi
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    94
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    95
cd $DISTPREFIX >> $DISTLOG 2>&1
13234
isatest
parents: 13233
diff changeset
    96
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    97
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    98
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    99
gzip -f $DISTLOG
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
   100
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
   101
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
   102
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
   103
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   104
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   105
## spawn test runs
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   106
15806
8941300da5a6 test stable and devel version of smlnj
kleing
parents: 15438
diff changeset
   107
$SSH sunbroy2 "$MAKEALL $DISTPREFIX $HOME/settings/sun-poly $HOME/settings/sun-sml $HOME/settings/sun-sml-dev"
14032
a6239314e380 give tests time to copy settings
kleing
parents: 13993
diff changeset
   108
# give test some time to copy settings and start
a6239314e380 give tests time to copy settings
kleing
parents: 13993
diff changeset
   109
sleep 5
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
   110
$SSH atbroy51 "$MAKEALL $DISTPREFIX $HOME/settings/at-poly $HOME/settings/at-sml"
15807
98bff95f88ba wakeonlan for macbroy33
isatest
parents: 15806
diff changeset
   111
# wakeup call for macbroy33
98bff95f88ba wakeonlan for macbroy33
isatest
parents: 15806
diff changeset
   112
wakeonlan -i 131.159.47.255 00:30:65:DA:35:E0 > /dev/null
14032
a6239314e380 give tests time to copy settings
kleing
parents: 13993
diff changeset
   113
sleep 5
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
   114
$SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly"
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   115
13234
isatest
parents: 13233
diff changeset
   116
## end