author | kleing |
Fri, 09 May 2003 12:08:00 +0200 | |
changeset 13991 | b289ab046d3b |
parent 13988 | 28c953b54cbe |
child 13993 | 88a8911bb65d |
permissions | -rwxr-xr-x |
13231 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# $Id$ |
|
4 |
# Author: Gerwin Klein, TU Muenchen |
|
5 |
# License: GPL (GNU GENERAL PUBLIC LICENSE) |
|
6 |
# |
|
7 |
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms. |
|
8 |
||
13237 | 9 |
# source bashrc, we're called by cron |
10 |
. ~/.bashrc |
|
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 | 14 |
|
13231 | 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 | 17 |
|
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 | 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 | 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 | 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 | 28 |
TAR=gtar |
13231 | 29 |
|
13233 | 30 |
SSH="ssh -f" |
13231 | 31 |
|
32 |
## diagnostics |
|
33 |
||
34 |
PRG="$(basename "$0")" |
|
35 |
||
36 |
function usage() |
|
37 |
{ |
|
38 |
echo |
|
39 |
echo "Usage: $PRG" |
|
40 |
echo |
|
41 |
echo " Build distribution and run isatest-make for lots of platforms." |
|
42 |
echo |
|
43 |
exit 1 |
|
44 |
} |
|
45 |
||
46 |
function fail() |
|
47 |
{ |
|
48 |
echo "$1" >&2 |
|
49 |
exit 2 |
|
50 |
} |
|
51 |
||
52 |
## main |
|
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 | 58 |
export DISTPREFIX |
59 |
||
13431
b0ba3b3573e1
changed date format for proper lexicographical ordering
isatest
parents:
13359
diff
changeset
|
60 |
DATE=$(date "+%Y-%m-%d") |
13231 | 61 |
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log |
62 |
||
63 |
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1 |
|
64 |
||
65 |
echo "### cleaning up old dist directory" >> $DISTLOG 2>&1 |
|
66 |
rm -rf $DISTPREFIX >> $DISTLOG 2>&1 |
|
67 |
||
13237 | 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 | 70 |
|
13231 | 71 |
echo "### building distribution" >> $DISTLOG 2>&1 |
72 |
$MAKEDIST - >> $DISTLOG 2>&1 |
|
73 |
||
74 |
if [ $? -ne 0 ] |
|
75 |
then |
|
76 |
echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 |
|
13237 | 77 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
78 |
echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG |
|
13246 | 79 |
|
13359 | 80 |
echo "Could not build isabelle distribution. Log file available at" > $TMP |
81 |
echo "$HOSTNAME:$DISTLOG" >> $TMP |
|
13246 | 82 |
|
13359 | 83 |
for R in $MAILTO; do |
84 |
$MAIL "isabelle dist build failed" $R $TMP |
|
13246 | 85 |
done |
86 |
||
13359 | 87 |
rm $TMP |
88 |
||
13231 | 89 |
exit 1 |
90 |
fi |
|
91 |
||
92 |
cd $DISTPREFIX >> $DISTLOG 2>&1 |
|
13234 | 93 |
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1 |
13231 | 94 |
|
13839 | 95 |
echo "### generating development snapshot web page" >> $DISTLOG 2>&1 |
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
96 |
(cd $HOME/devel-page; make) |
13839 | 97 |
|
13231 | 98 |
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 |
13237 | 99 |
gzip -f $DISTLOG |
100 |
||
101 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
|
102 |
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG |
|
103 |
||
13231 | 104 |
|
105 |
## spawn test runs |
|
106 |
||
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
107 |
$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
|
108 |
$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
|
109 |
$SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly" |
13231 | 110 |
|
13234 | 111 |
## end |