Admin/isatest-makedist
author kleing
Fri, 09 May 2003 14:15:50 +0200
changeset 13993 88a8911bb65d
parent 13991 b289ab046d3b
child 14032 a6239314e380
permissions -rwxr-xr-x
only make development snapshots for successful tests
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
# License: GPL (GNU GENERAL PUBLIC LICENSE)
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     6
#
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     7
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
     8
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
     9
# source bashrc, we're called by cron
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    10
. ~/.bashrc
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    11
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    12
# 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
    13
HOME=/usr/stud/isatest
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    14
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    15
## global settings
13680
a6ce43a59d4a switched to atbroy51, removed markus from email list
isatest
parents: 13431
diff changeset
    16
MAILTO="kleing@in.tum.de nipkow@in.tum.de berghofe@in.tum.de schirmer@in.tum.de lp15@cam.ac.uk"
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    17
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    18
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
    19
MAIL=$HOME/bin/pmail
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    20
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    21
LOGPREFIX=$HOME/log
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    22
MASTERLOG=$LOGPREFIX/isatest.log
13988
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    23
ERRORLOG=$HOME/var/error.log
13991
b289ab046d3b var/run -> var/running
kleing
parents: 13988
diff changeset
    24
RUNNING=$HOME/var/running
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
    25
DISTPREFIX=$HOME/isadist
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
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    29
13233
kleing
parents: 13231
diff changeset
    30
SSH="ssh -f"
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    31
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    32
## diagnostics
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    33
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    34
PRG="$(basename "$0")"
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    35
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    36
function usage()
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    37
{
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    38
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    39
  echo "Usage: $PRG"
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    40
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    41
  echo "   Build distribution and run isatest-make for lots of platforms."
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    42
  echo
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    43
  exit 1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    44
}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    45
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    46
function fail()
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    47
{
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    48
  echo "$1" >&2
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    49
  exit 2
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    50
}
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    51
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    52
## main
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    53
13988
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    54
# 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
    55
rm -f $ERRORLOG
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    56
rm -f $RUNNING/*.runnning
28c953b54cbe add cleanup of old error log and test-still-running files
kleing
parents: 13962
diff changeset
    57
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    58
export DISTPREFIX
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    59
13431
b0ba3b3573e1 changed date format for proper lexicographical ordering
isatest
parents: 13359
diff changeset
    60
DATE=$(date "+%Y-%m-%d")
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    61
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    62
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    63
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    64
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    65
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    66
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    67
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    68
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
    69
rm -rf $HOME/isabelle-*
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    70
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    71
echo "### building distribution"  >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    72
$MAKEDIST - >> $DISTLOG 2>&1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    73
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    74
if [ $? -ne 0 ]
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    75
then
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    76
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    77
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    78
    echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    79
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    80
    echo "Could not build isabelle distribution. Log file available at" > $TMP
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    81
    echo "$HOSTNAME:$DISTLOG" >> $TMP
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    82
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    83
    for R in $MAILTO; do
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    84
	$MAIL "isabelle dist build failed" $R $TMP
13246
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    85
    done
e51efc2029e9 email sending
isatest
parents: 13237
diff changeset
    86
13359
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    87
    rm $TMP
982827aacb39 mail address update
isatest
parents: 13246
diff changeset
    88
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    89
    exit 1
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    90
fi
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    91
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    92
cd $DISTPREFIX >> $DISTLOG 2>&1
13234
isatest
parents: 13233
diff changeset
    93
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    94
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
    95
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
13237
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    96
gzip -f $DISTLOG
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    97
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    98
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
    99
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG
493d61afa731 cleanup old isabelle-* dirs before test start
isatest
parents: 13234
diff changeset
   100
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   101
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   102
## spawn test runs
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   103
13962
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
   104
$SSH sunbroy2 "$MAKEALL $DISTPREFIX $HOME/settings/sun-poly $HOME/settings/sun-sml"
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
   105
$SSH atbroy51 "$MAKEALL $DISTPREFIX $HOME/settings/at-poly $HOME/settings/at-sml"
908f6776a59b use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents: 13955
diff changeset
   106
$SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly"
13231
cce28efb2600 for nightly test builds
kleing
parents:
diff changeset
   107
13234
isatest
parents: 13233
diff changeset
   108
## end