mnightly 1.61 KB
#! /bin/sh
#
#  An example of how one could invoke mmake from a crontab entry is
#
#  1 2 * * * /usr/bin/nice sh $HOME/build/mnightly > /dev/null 2>&1
#
#  (cron will fire off this script every morning at 2:01am).
#

#
# Need the following environment variables to build
#

PATH=.:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/etc:/usr/etc:/usr/bin/X11
export PATH

VCS_NETHOST=ubangi
export VCS_NETHOST

ECS_ROOT=/hosts/venice/ecad/ecs/ecs_2.4
export ECS_ROOT

INSTOPTS=-t
export INSTOPTS

BUILD=$HOME/mdevroot
cd $BUILD
USAGE="mnightly [-a], where -a optionally runs nightly regressions"

REGRESSION=FALSE

while getopts a c
do
    case $c in
	a)	REGRESSION=TRUE ;;
	\?)	echo $USAGE; exit 2 ;;
    esac
done

#
# This assumes you have automount running to gain access to the source tree.
#
if [ -s /hosts/madman/mdev/PR/doc/mmake ]
then
    cp /hosts/madman/mdev/PR/doc/mmake $HOME/bin/mmake
    chmod +rw $HOME/bin/mmake
fi

#
# To temporarily turn off nightly builds, create a file called ultra64.skip
# in your $HOME/mdevroot directory.
#
if [ ! -f $BUILD/ultra64.skip ] 
then
{
#    trap "rm -f $BUILD/ultra64.skip; exit 0" 0 1 2 15
#    touch $BUILD/ultra64.skip
    date
    echo "\n\nSTARTING NIGHTLY ULTRA64 BUILD\n\n"
	
    set -x
    WORKAREA=$HOME/mdevroot
    if test $REGRESSION = TRUE
    then
	$HOME/bin/mmake -acuH -W $WORKAREA
    else
	$HOME/bin/mmake -cuH -W $WORKAREA
    fi

    echo "\n\nDONE NIGHTLY ULTRA64 BUILD\n\n"
    date

#    rm $BUILD/ultra64.skip
} > $BUILD/rawbuildlog 2>&1
fi

fold -1022 $BUILD/rawbuildlog > ultra64.log
rm rawbuildlog
$HOME/build/filter_buildlog ultra64.log | /usr/sbin/Mail -s "ULTRA64 build" $LOGNAME