Admin/isatest/isatest-makedist
author wenzelm
Tue Jun 26 15:55:02 2012 +0200 (2012-06-26)
changeset 48147 a29f3f44e198
parent 47471 d6a1b5aeb4b1
child 48157 303a7384cffd
permissions -rwxr-xr-x
use macbroy27 instead of macbroy28, which is broken for several weeks already;
     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-e"
    59 
    60 echo "### building distribution"  >> $DISTLOG 2>&1
    61 mkdir -p $DISTPREFIX
    62 $MAKEDIST -j "/home/isabelle/contrib_devel/jedit_build-20120414" >> $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 ISABELLE_DIST=`cat $DISTPREFIX/ISABELLE_DIST`
    84 $TAR xvzf $ISABELLE_DIST >> $DISTLOG 2>&1
    85 ln -sf $(basename $ISABELLE_DIST .tar.gz) Isabelle
    86 cp Isabelle/etc/settings Isabelle/etc/settings.orig
    87 
    88 ssh atbroy102 "rm -rf /home/isatest/isadist && mkdir -p /home/isatest/isadist" && \
    89 rsync -a "$HOME/isadist/." atbroy102:/home/isatest/isadist/.
    90 
    91 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    92 
    93 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    94 log "dist build successful, elapsed time $ELAPSED."
    95 
    96 ## clean up var/running
    97 rm -f $RUNNING/*
    98 
    99 ## spawn test runs
   100 
   101 $SSH macbroy21 "$MAKEALL $HOME/settings/at-poly-test"
   102 # give test some time to copy settings and start
   103 sleep 15
   104 $SSH macbroy27 "$MAKEALL $HOME/settings/at-poly; $MAKEALL $HOME/settings/at-poly-e"
   105 sleep 15
   106 $SSH macbroy22 "$MAKEALL -l HOL HOL-Library $HOME/settings/at-sml-dev-e"
   107 sleep 15
   108 $SSH macbroy24 "$MAKEALL $HOME/settings/at64-poly"
   109 sleep 15
   110 $SSH macbroy2 "
   111   $MAKEALL -l . full $HOME/settings/mac-poly64-M4;
   112   $MAKEALL -l . full $HOME/settings/mac-poly64-M8;
   113   $MAKEALL $HOME/settings/mac-poly-M4;
   114   $MAKEALL $HOME/settings/mac-poly-M8"
   115 sleep 15
   116 $SSH macbroy6 "$MAKEALL $HOME/settings/mac-poly64-M2"
   117 sleep 15
   118 $SSH macbroy30 "sleep 10800; $MAKEALL $HOME/settings/mac-poly-M2"
   119 sleep 15
   120 $SSH atbroy102 "$MAKEALL $HOME/settings/cygwin-poly-e"
   121 #sleep 15
   122 #$SSH atbroy51 "$HOME/admin/isatest/isatest-annomaly"
   123 
   124 echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
   125 
   126 gzip -f $DISTLOG
   127 
   128 ## end