- Introduce a WEBMAILTO (not just 'MAILTO' since that might be used

for something else) variable that specifies a e-mail address to send
  a failed build report to.  Previously, this script would push part
  of the log to stdout for cron to do that, but that would always send
  it to the job owner, which may not necessarily be the person who can
  fix the problem.  Set the default to 'freebsd-doc' (the @freebsd.org
  was explicitly left off so that if someone runs this on something
  other than freefall, the -doc list won't get mail about problems
  they probably didn't cause).
- Rename the default log file to log.make.* to be consistent with the
  previous version of this.
- Include the hour in the log file.  The web build runs more than once
  per day, and it's nice to be able to keep the log files.
- Set umask 002 so that people in the WEBGRP can do what they need
  without su'ing to wosch.

Obtained from:	wosch
This commit is contained in:
Dima Dorfman 2001-08-31 17:37:33 +00:00
parent 918ff72bb0
commit 7d5d5488e3
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=10516

View file

@ -14,6 +14,7 @@
# LOGFILE - Name of the log file to use (in $BUILDDIR).
# BUILDARGS - Arguments to pass to make(1) when {build,install}ing.
# INSTARGS - Arguments to pass to make(1) when installing.
# WEBMAILTO - Address to send mail to if the build fails.
#
# subtrees - List of directores in $BUILDDIR which are from CVS.
#
@ -30,7 +31,7 @@
# 2 - failure in CVS operations
# 3 - failure in make operations
#
# $FreeBSD: www/tools/webupdate,v 1.5 2001/08/30 06:59:19 dd Exp $
# $FreeBSD: www/tools/webupdate,v 1.6 2001/08/31 17:09:21 dd Exp $
#
#
@ -40,9 +41,10 @@ DEFAULT_PATH=/bin:/usr/bin:/usr/local/bin;
DEFAULT_CVSROOT=/home/ncvs;
DEFAULT_BUILDDIR=/usr/local/www/build;
DEFAULT_DESTDIR=/usr/local/www;
DEFAULT_LOGFILE=log.webbuild.`date '+%d'`;
DEFAULT_LOGFILE=log.make.`date '+%d.%H'`;
DEFAULT_BUILDARGS='';
DEFAULT_INSTARGS='';
DEFAULT_WEBMAILTO=freebsd-doc;
#
# Variable setup.
@ -54,6 +56,7 @@ DESTDIR=${DESTDIR:-${DEFAULT_DESTDIR}};
LOGFILE=${LOGFILE:-${BUILDDIR}/${DEFAULT_LOGFILE}};
BUILDARGS=${BUILDARGS:-${DEFAULT_BUILDARGS}};
INSTARGS="${BUILDARGS} ${INSTARGS:-${DEFAULT_INSTARGS}}";
WEBMAILTO=${WEBMAILTO:-${DEFAULT_WEBMAILTO}};
# Notes on the names of the release notes directories:
#
@ -119,7 +122,9 @@ cd $BUILDDIR/www/en || exit 1;
time make ${BUILDARGS} all >> $LOGFILE 2>&1 &&
time make ${INSTARGS} DESTDIR=$DESTDIR install >> $LOGFILE 2>&1 ||
(tail -50 $LOGFILE && exit 3);
(tail -50 $LOGFILE |
mail -s "FreeBSD web build failed on `hostname`" $WEBMAILTO &&
exit 3);
exit 0;