Admin/isatest/isatest-makedist
author wenzelm
Tue Aug 14 10:44:03 2012 +0200 (2012-08-14)
changeset 48790 6e739225dd8a
parent 48635 bfce940c6f38
child 48832 ab9663b8734b
permissions -rwxr-xr-x
always retain doc-src (as regular component);
     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 
    20 ## diagnostics
    21 
    22 PRG="$(basename "$0")"
    23 
    24 function usage()
    25 {
    26   echo
    27   echo "Usage: $PRG"
    28   echo
    29   echo "   Build distribution and run isatest-make for lots of platforms."
    30   echo
    31   exit 1
    32 }
    33 
    34 function fail()
    35 {
    36   echo "$1" >&2
    37   exit 2
    38 }
    39 
    40 
    41 ## main
    42 
    43 # cleanup old error log and test-still-running files
    44 rm -f $ERRORLOG
    45 rm -f $ERRORDIR/isatest-*.log
    46 rm -f $RUNNING/*.runnning
    47 
    48 export DISTPREFIX
    49 
    50 DATE=$(date "+%Y-%m-%d")
    51 DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
    52 
    53 echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
    54 
    55 echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
    56 rm -rf $DISTPREFIX >> $DISTLOG 2>&1
    57 
    58 echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
    59 rm -rf $HOME/isabelle-*
    60 
    61 echo "### building distribution"  >> $DISTLOG 2>&1
    62 mkdir -p $DISTPREFIX
    63 $MAKEDIST -j "/home/isabelle/contrib_devel/jedit_build-20120414" >> $DISTLOG 2>&1
    64 
    65 if [ $? -ne 0 ]
    66 then
    67     echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    68     ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    69     log "dist build FAILED, elapsed time $ELAPSED."
    70 
    71     echo "Could not build isabelle distribution. Log file available at" > $TMP
    72     echo "$HOSTNAME:$DISTLOG" >> $TMP
    73 
    74     for R in $MAILTO; do
    75         $MAIL "isabelle dist build failed" $R $TMP
    76     done
    77 
    78     rm $TMP
    79 
    80     exit 1
    81 fi
    82 
    83 cd $DISTPREFIX >> $DISTLOG 2>&1
    84 ISABELLE_DIST=`cat $DISTPREFIX/ISABELLE_DIST`
    85 $TAR xvzf $ISABELLE_DIST >> $DISTLOG 2>&1
    86 ln -sf $(basename $ISABELLE_DIST .tar.gz) Isabelle
    87 cp Isabelle/etc/settings Isabelle/etc/settings.orig
    88 
    89 echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    90 
    91 ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
    92 log "dist build successful, elapsed time $ELAPSED."
    93 
    94 
    95 ## clean up var/running
    96 rm -f $RUNNING/*
    97 mkdir -p $RUNNING
    98 
    99 
   100 ## spawn test runs
   101 
   102 $SSH lxbroy2 "
   103   $MAKEALL $HOME/settings/at-poly;
   104   $MAKEALL $HOME/settings/at-poly-test"
   105 sleep 15
   106 $SSH lxbroy3 "
   107   $MAKEALL $HOME/settings/at64-poly;
   108   $MAKEALL -l HOL-Library $HOME/settings/at-sml-dev-e"
   109 sleep 15
   110 $SSH macbroy23 "$MAKEALL $HOME/settings/at-poly-e"
   111 sleep 15
   112 $SSH macbroy2 "
   113   $MAKEALL $HOME/settings/mac-poly64-M4;
   114   $MAKEALL $HOME/settings/mac-poly64-M8;
   115   $MAKEALL $HOME/settings/mac-poly-M4;
   116   $MAKEALL $HOME/settings/mac-poly-M8"
   117 sleep 15
   118 $SSH macbroy6 "$MAKEALL $HOME/settings/mac-poly64-M2"
   119 sleep 15
   120 $SSH macbroy30 "sleep 10800; $MAKEALL $HOME/settings/mac-poly-M2"
   121 
   122 echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
   123 
   124 gzip -f $DISTLOG
   125