| author | haftmann | 
| Fri, 20 Feb 2009 10:14:31 +0100 | |
| changeset 30006 | f54b48cda286 | 
| parent 28931 | 498b63ba782c | 
| child 31385 | bc1f918ccf68 | 
| permissions | -rwxr-xr-x | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 1 | #!/usr/bin/env bash | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 2 | # | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 3 | # $Id$ | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 4 | # Author: Gerwin Klein, TU Muenchen | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 5 | # | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 6 | # DESCRIPTION: Build distribution and run isatest-make for lots of platforms. | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 7 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 8 | ## global settings | 
| 22411 | 9 | . ~/admin/isatest/isatest-settings | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 10 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 11 | TMP=/tmp/isatest-makedist.$$ | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 12 | MAIL=$HOME/bin/pmail | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 13 | |
| 28931 
498b63ba782c
renamed makedist_mercurial to makedist, deleting the old version;
 wenzelm parents: 
28607diff
changeset | 14 | MAKEDIST=$HOME/bin/makedist | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 15 | MAKEALL=$HOME/bin/isatest-makeall | 
| 27084 | 16 | TAR=tar | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 17 | CVS2CL="$HOME/bin/cvs2cl --follow-only TRUNK" | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 18 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 19 | SSH="ssh -f" | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 20 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 21 | ## diagnostics | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 22 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 23 | PRG="$(basename "$0")" | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 24 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 25 | function usage() | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 26 | {
 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 27 | echo | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 28 | echo "Usage: $PRG" | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 29 | echo | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 30 | echo " Build distribution and run isatest-make for lots of platforms." | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 31 | echo | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 32 | exit 1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 33 | } | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 34 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 35 | function fail() | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 36 | {
 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 37 | echo "$1" >&2 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 38 | exit 2 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 39 | } | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 40 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 41 | ## main | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 42 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 43 | # cleanup old error log and test-still-running files | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 44 | rm -f $ERRORLOG | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 45 | rm -f $ERRORDIR/isatest-*.log | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 46 | rm -f $RUNNING/*.runnning | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 47 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 48 | export DISTPREFIX | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 49 | export CVS2CL | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 50 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 51 | DATE=$(date "+%Y-%m-%d") | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 52 | DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 53 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 54 | echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 55 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 56 | echo "### cleaning up old dist directory" >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 57 | rm -rf $DISTPREFIX >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 58 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 59 | echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 60 | rm -rf $HOME/isabelle-* | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 61 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 62 | echo "### building distribution" >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 63 | mkdir -p $DISTPREFIX | 
| 28418 
4ffb62675ade
slightly different command line for makedist_mercurial
 kleing parents: 
28387diff
changeset | 64 | $MAKEDIST >> $DISTLOG 2>&1 | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 65 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 66 | if [ $? -ne 0 ] | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 67 | then | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 68 | echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 69 |     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
 | 
| 28539 
bdb308737bfd
do logging to MASTERLOG centrally (avoid multiple writers over NFS as
 kleing parents: 
28418diff
changeset | 70 | log "dist build FAILED, elapsed time $ELAPSED." | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 71 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 72 | echo "Could not build isabelle distribution. Log file available at" > $TMP | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 73 | echo "$HOSTNAME:$DISTLOG" >> $TMP | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 74 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 75 | for R in $MAILTO; do | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 76 | $MAIL "isabelle dist build failed" $R $TMP | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 77 | done | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 78 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 79 | rm $TMP | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 80 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 81 | exit 1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 82 | fi | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 83 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 84 | cd $DISTPREFIX >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 85 | $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 86 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 87 | echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 88 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 89 | ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
 | 
| 28539 
bdb308737bfd
do logging to MASTERLOG centrally (avoid multiple writers over NFS as
 kleing parents: 
28418diff
changeset | 90 | log "dist build successful, elapsed time $ELAPSED." | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 91 | |
| 22413 
3df5c44482e2
clean up var/running dir before spawning new tests
 kleing parents: 
22411diff
changeset | 92 | ## clean up var/running | 
| 
3df5c44482e2
clean up var/running dir before spawning new tests
 kleing parents: 
22411diff
changeset | 93 | rm -f $RUNNING/* | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 94 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 95 | ## spawn test runs | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 96 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 97 | $SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly" | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 98 | # give test some time to copy settings and start | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 99 | sleep 15 | 
| 26727 
b0d3e33c5093
move some at/a64 tests to intel mac hardware (running Linux)
 isatest parents: 
25912diff
changeset | 100 | $SSH macbroy21 "$MAKEALL $HOME/settings/at-poly" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 101 | sleep 15 | 
| 26727 
b0d3e33c5093
move some at/a64 tests to intel mac hardware (running Linux)
 isatest parents: 
25912diff
changeset | 102 | $SSH macbroy20 "$MAKEALL $HOME/settings/at-poly-5.1-para-e" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 103 | sleep 15 | 
| 27539 | 104 | #$SSH macbroy24 "$MAKEALL -l HOL proofterms $HOME/settings/at-sml-dev-p" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 105 | #sleep 15 | 
| 26727 
b0d3e33c5093
move some at/a64 tests to intel mac hardware (running Linux)
 isatest parents: 
25912diff
changeset | 106 | $SSH macbroy22 "$MAKEALL $HOME/settings/at64-poly-5.1-para" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 107 | sleep 15 | 
| 28607 | 108 | $SSH macbroy23 "$MAKEALL -l HOL $HOME/settings/at-sml-dev-e" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 109 | sleep 15 | 
| 25532 
27f6771ae8fb
switch poly to 5.1, removed -e flag from most sessions
 kleing parents: 
24758diff
changeset | 110 | $SSH atbroy101 "$MAKEALL $HOME/settings/at64-poly" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 111 | sleep 15 | 
| 27488 | 112 | $SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 113 | sleep 15 | 
| 25532 
27f6771ae8fb
switch poly to 5.1, removed -e flag from most sessions
 kleing parents: 
24758diff
changeset | 114 | $SSH macbroy6 "/usr/stud/isatest/bin/isatest-makeall $HOME/settings/at-mac-poly-5.1-para" | 
| 28598 
cb5f98e2e187
give more time to do inital loggin and settings read
 kleing parents: 
28539diff
changeset | 115 | sleep 15 | 
| 22640 | 116 | $SSH atbroy51 "$HOME/admin/isatest/isatest-annomaly" | 
| 22410 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 117 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 118 | echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1 | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 119 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 120 | gzip -f $DISTLOG | 
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 121 | |
| 
da313b67a04d
moved all isatest/cron job related files to own directory
 kleing parents: diff
changeset | 122 | ## end |