Admin/isatest/isatest-makedist
author wenzelm
Sat Apr 17 19:35:35 2010 +0200 (2010-04-17)
changeset 36192 d4ec9ddd0e21
parent 36161 e30e51b7e4dc
child 36242 d65f943b9f07
permissions -rwxr-xr-x
isatest: more robust treatment of remote files, less reliance on mounted file system;
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Gerwin Klein, TU Muenchen
     4 #
     5 # DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
     6 
     7 ## global settings
     8 . ~/admin/isatest/isatest-settings
     9 
    10 TMP=/tmp/isatest-makedist.$$
    11 MAIL=$HOME/bin/pmail
    12 
    13 MAKEDIST=$HOME/bin/makedist
    14 MAKEALL=$HOME/bin/isatest-makeall
    15 TAR=tar
    16 
    17 SSH="ssh -f"
    18 
    19 ## diagnostics
    20 
    21 PRG="$(basename "$0")"
    22 
    23 function usage()
    24 {
    25   echo
    26   echo "Usage: $PRG"
    27   echo
    28   echo "   Build distribution and run isatest-make for lots of platforms."
    29   echo
    30   exit 1
    31 }
    32 
    33 function fail()
    34 {
    35   echo "$1" >&2
    36   exit 2
    37 }
    38 
    39 ## main
    40 
    41 # cleanup old error log and test-still-running files
    42 rm -f $ERRORLOG
    43 rm -f $ERRORDIR/isatest-*.log
    44 rm -f $RUNNING/*.runnning
    45 
    46 export DISTPREFIX
    47 
    48 DATE=$(date "+%Y-%m-%d")
    49 DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
    50 
    51 echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
    52 
    53 echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
    54 rm -rf $DISTPREFIX >> $DISTLOG 2>&1
    55 
    56 echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
    57 rm -rf $HOME/isabelle-*
    58 ssh atbroy102 "rm -rf /home/isatest/isabelle-cygwin-poly"
    59 
    60 echo "### building distribution"  >> $DISTLOG 2>&1
    61 mkdir -p $DISTPREFIX
    62 $MAKEDIST >> $DISTLOG 2>&1
    63 
    64 if [ $? -ne 0 ]
    65 then
    66     echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    67     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    68     log "dist build FAILED, elapsed time $ELAPSED."
    69 
    70     echo "Could not build isabelle distribution. Log file available at" > $TMP
    71     echo "$HOSTNAME:$DISTLOG" >> $TMP
    72 
    73     for R in $MAILTO; do
    74         $MAIL "isabelle dist build failed" $R $TMP
    75     done
    76 
    77     rm $TMP
    78 
    79     exit 1
    80 fi
    81 
    82 cd $DISTPREFIX >> $DISTLOG 2>&1
    83 $TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
    84 
    85 ssh atbroy102 "rm -rf /home/isatest/isadist && mkdir -p /home/isatest/isadist" && \
    86 rsync -a "$HOME/isadist/." atbroy102:/home/isatest/isadist/.
    87 
    88 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    89 
    90 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    91 log "dist build successful, elapsed time $ELAPSED."
    92 
    93 ## clean up var/running
    94 rm -f $RUNNING/*
    95 
    96 ## spawn test runs
    97 
    98 $SSH macbroy21 "$MAKEALL $HOME/settings/at-poly-test"
    99 # give test some time to copy settings and start
   100 sleep 15
   101 $SSH macbroy22 "$MAKEALL $HOME/settings/at-poly"
   102 sleep 15
   103 $SSH macbroy23 "$MAKEALL -l HOL HOL-Library $HOME/settings/at-sml-dev-e"
   104 sleep 15
   105 $SSH macbroy24 "$MAKEALL $HOME/settings/at64-poly"
   106 sleep 15
   107 $SSH macbroy2 "$MAKEALL $HOME/settings/mac-poly64-M4; $MAKEALL $HOME/settings/mac-poly64-M8; $MAKEALL $HOME/settings/mac-poly-M4; $MAKEALL $HOME/settings/mac-poly-M8"
   108 sleep 15
   109 $SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly"
   110 sleep 15
   111 $SSH macbroy6 "sleep 10800; $MAKEALL $HOME/settings/at-mac-poly-5.1-para"
   112 sleep 15
   113 $SSH atbroy102 "$MAKEALL $HOME/settings/cygwin-poly"
   114 #sleep 15
   115 #$SSH atbroy51 "$HOME/admin/isatest/isatest-annomaly"
   116 #sleep 15
   117 #$SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly"
   118 
   119 echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
   120 
   121 gzip -f $DISTLOG
   122 
   123 ## end