Admin/isatest-makedist
author kleing
Thu, 20 Jun 2002 22:17:28 +0200
changeset 13233 5ab7bac534c9
parent 13231 cce28efb2600
child 13234 8139edae3bf5
permissions -rwxr-xr-x
tuned

#!/usr/bin/env bash
#
# $Id$
# Author: Gerwin Klein, TU Muenchen
# License: GPL (GNU GENERAL PUBLIC LICENSE)
#
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.

## global settings
LOGPREFIX=~/log
DISTPREFIX=~/isadist
MAKEDIST=~/bin/makedist

SUN=sunbroy2
AT=atbroy37

SSH="ssh -f"

## diagnostics

PRG="$(basename "$0")"

function usage()
{
  echo
  echo "Usage: $PRG"
  echo
  echo "   Build distribution and run isatest-make for lots of platforms."
  echo
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}

## main

export DISTPREFIX

DATE=$(date "+%d-%b-%Y")
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log

echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1

echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
rm -rf $DISTPREFIX >> $DISTLOG 2>&1

echo "### building distribution"  >> $DISTLOG 2>&1
$MAKEDIST - >> $DISTLOG 2>&1

if [ $? -ne 0 ]
then
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
    # more action here
    exit 1
fi

cd $DISTPREFIX >> $DISTLOG 2>&1
tar xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1

echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1

## spawn test runs

# run tests in parallel on multiprocessor sun 
$SSH $SUN "$MAKEDIST $DISTPREFIX ~/settings/sun-poly"
$SSH $SUN "$MAKEDIST $DISTPREFIX ~/settings/sun-sml"

# run tests sequentially on x86
$SSH $AT "$MAKEDIST $DISTPREFIX ~/settings/at-poly ~/settings/at-sml"

## end