author | kleing |
Sun, 18 May 2003 16:16:58 +0200 | |
changeset 14037 | 3b7f3eec9684 |
parent 14032 | a6239314e380 |
child 14170 | edd5a2ea3807 |
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 |
14037 | 23 |
ERRORDIR=$HOME/var |
24 |
ERRORLOG=$ERRORDIR/error.log |
|
13991 | 25 |
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
|
26 |
DISTPREFIX=$HOME/isadist |
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
27 |
MAKEDIST=$HOME/bin/makedist |
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
28 |
MAKEALL=$HOME/bin/isatest-makeall |
13234 | 29 |
TAR=gtar |
13231 | 30 |
|
13233 | 31 |
SSH="ssh -f" |
13231 | 32 |
|
33 |
## diagnostics |
|
34 |
||
35 |
PRG="$(basename "$0")" |
|
36 |
||
37 |
function usage() |
|
38 |
{ |
|
39 |
echo |
|
40 |
echo "Usage: $PRG" |
|
41 |
echo |
|
42 |
echo " Build distribution and run isatest-make for lots of platforms." |
|
43 |
echo |
|
44 |
exit 1 |
|
45 |
} |
|
46 |
||
47 |
function fail() |
|
48 |
{ |
|
49 |
echo "$1" >&2 |
|
50 |
exit 2 |
|
51 |
} |
|
52 |
||
53 |
## main |
|
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 | 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 | 60 |
export DISTPREFIX |
61 |
||
13431
b0ba3b3573e1
changed date format for proper lexicographical ordering
isatest
parents:
13359
diff
changeset
|
62 |
DATE=$(date "+%Y-%m-%d") |
13231 | 63 |
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log |
64 |
||
65 |
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1 |
|
66 |
||
67 |
echo "### cleaning up old dist directory" >> $DISTLOG 2>&1 |
|
68 |
rm -rf $DISTPREFIX >> $DISTLOG 2>&1 |
|
69 |
||
13237 | 70 |
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
|
71 |
rm -rf $HOME/isabelle-* |
13237 | 72 |
|
13231 | 73 |
echo "### building distribution" >> $DISTLOG 2>&1 |
74 |
$MAKEDIST - >> $DISTLOG 2>&1 |
|
75 |
||
76 |
if [ $? -ne 0 ] |
|
77 |
then |
|
78 |
echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 |
|
13237 | 79 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
80 |
echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG |
|
13246 | 81 |
|
13359 | 82 |
echo "Could not build isabelle distribution. Log file available at" > $TMP |
83 |
echo "$HOSTNAME:$DISTLOG" >> $TMP |
|
13246 | 84 |
|
13359 | 85 |
for R in $MAILTO; do |
14037 | 86 |
$MAIL "isabelle dist build failed" $R $TMP |
13246 | 87 |
done |
88 |
||
13359 | 89 |
rm $TMP |
90 |
||
13231 | 91 |
exit 1 |
92 |
fi |
|
93 |
||
94 |
cd $DISTPREFIX >> $DISTLOG 2>&1 |
|
13234 | 95 |
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1 |
13231 | 96 |
|
97 |
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 |
|
13237 | 98 |
gzip -f $DISTLOG |
99 |
||
100 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
|
101 |
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG |
|
102 |
||
13231 | 103 |
|
104 |
## spawn test runs |
|
105 |
||
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
106 |
$SSH sunbroy2 "$MAKEALL $DISTPREFIX $HOME/settings/sun-poly $HOME/settings/sun-sml" |
14032 | 107 |
# give test some time to copy settings and start |
108 |
sleep 5 |
|
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
109 |
$SSH atbroy51 "$MAKEALL $DISTPREFIX $HOME/settings/at-poly $HOME/settings/at-sml" |
14032 | 110 |
# give test some time to copy settings and start |
111 |
sleep 5 |
|
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
112 |
$SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly" |
13231 | 113 |
|
13234 | 114 |
## end |