author | schirmer |
Fri, 05 Nov 2004 15:37:25 +0100 | |
changeset 15273 | 771af451a062 |
parent 14981 | e73f8140af78 |
child 15438 | dfc7d2a824d6 |
permissions | -rwxr-xr-x |
13231 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# $Id$ |
|
4 |
# Author: Gerwin Klein, TU Muenchen |
|
5 |
# |
|
6 |
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms. |
|
7 |
||
13237 | 8 |
# source bashrc, we're called by cron |
9 |
. ~/.bashrc |
|
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 | 13 |
|
13231 | 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 | 16 |
|
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 | 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 | 21 |
MASTERLOG=$LOGPREFIX/isatest.log |
14037 | 22 |
ERRORDIR=$HOME/var |
23 |
ERRORLOG=$ERRORDIR/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 |
14037 | 56 |
rm -f $ERRORDIR/isatest-*.log |
13988
28c953b54cbe
add cleanup of old error log and test-still-running files
kleing
parents:
13962
diff
changeset
|
57 |
rm -f $RUNNING/*.runnning |
28c953b54cbe
add cleanup of old error log and test-still-running files
kleing
parents:
13962
diff
changeset
|
58 |
|
13231 | 59 |
export DISTPREFIX |
60 |
||
13431
b0ba3b3573e1
changed date format for proper lexicographical ordering
isatest
parents:
13359
diff
changeset
|
61 |
DATE=$(date "+%Y-%m-%d") |
13231 | 62 |
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log |
63 |
||
64 |
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1 |
|
65 |
||
66 |
echo "### cleaning up old dist directory" >> $DISTLOG 2>&1 |
|
67 |
rm -rf $DISTPREFIX >> $DISTLOG 2>&1 |
|
68 |
||
13237 | 69 |
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
|
70 |
rm -rf $HOME/isabelle-* |
13237 | 71 |
|
13231 | 72 |
echo "### building distribution" >> $DISTLOG 2>&1 |
73 |
$MAKEDIST - >> $DISTLOG 2>&1 |
|
74 |
||
75 |
if [ $? -ne 0 ] |
|
76 |
then |
|
77 |
echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 |
|
13237 | 78 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
79 |
echo "$(date) $HOSTNAME $PRG: dist build FAILED, elapsed time $ELAPSED." >> $MASTERLOG |
|
13246 | 80 |
|
13359 | 81 |
echo "Could not build isabelle distribution. Log file available at" > $TMP |
82 |
echo "$HOSTNAME:$DISTLOG" >> $TMP |
|
13246 | 83 |
|
13359 | 84 |
for R in $MAILTO; do |
14037 | 85 |
$MAIL "isabelle dist build failed" $R $TMP |
13246 | 86 |
done |
87 |
||
13359 | 88 |
rm $TMP |
89 |
||
13231 | 90 |
exit 1 |
91 |
fi |
|
92 |
||
93 |
cd $DISTPREFIX >> $DISTLOG 2>&1 |
|
13234 | 94 |
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1 |
13231 | 95 |
|
96 |
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 |
|
13237 | 97 |
gzip -f $DISTLOG |
98 |
||
99 |
ELAPSED=$("$HOME/bin/showtime" "$SECONDS") |
|
100 |
echo "$(date) $HOSTNAME $PRG: dist build successful, elapsed time $ELAPSED." >> $MASTERLOG |
|
101 |
||
13231 | 102 |
|
103 |
## spawn test runs |
|
104 |
||
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
105 |
$SSH sunbroy2 "$MAKEALL $DISTPREFIX $HOME/settings/sun-poly $HOME/settings/sun-sml" |
14032 | 106 |
# give test some time to copy settings and start |
107 |
sleep 5 |
|
13962
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" |
14032 | 109 |
# give test some time to copy settings and start |
110 |
sleep 5 |
|
13962
908f6776a59b
use /usr/stud/isatest as home for all platforms (macbroy33 has no /home/stud/..)
kleing
parents:
13955
diff
changeset
|
111 |
$SSH macbroy33 "$MAKEALL $DISTPREFIX $HOME/settings/mac-poly" |
13231 | 112 |
|
13234 | 113 |
## end |