cron-script.sh revision 10589
# Sample usage in crontab:
# Run, Mon-Fri at 1:30am. Add to build user's crontab.
# 30 1 * * 1-5 . /jds/cbe/bin/env.sh; cd /jds/spec-files; I_KNOW_WHAT_IM_DOING=yes ./cron-script.sh
#
# The same with a jail. Add to root's crontab. Example assumes 'gbuild' is the
# build user
# 30 1 * * 1-5 /usr/sbin/chroot /path/to/jail/root /usr/bin/su - gbuild -c ". /jds/cbe/bin/env.sh; cd /jds/spec-files; I_KNOW_WHAT_IM_DOING=yes ./cron-script.sh"
#
# $Id$
OSarch_full=`uname -p`
if [ "x$OSarch_full" = "xsparc" ]; then
OSarch=s
else
OSarch=x
fi
PRODNAME="G2.20"
# date format appended to the Release tag in the spec files
# (passed to the date command on the cmd line)
RELEASE_DATE_FMT="%y%m%d"
# date format used for naming the directories
DIR_DATE_FMT="%Y-%m-%d"
# document root of the web server
# subdir to keep logs and reports on the webserver
# ------------ nothing to configure below this line --------------
if [ "x$I_KNOW_WHAT_IM_DOING" != xyes ]; then
echo " ,---------------------------------------------------------------."
echo "| This script is intended to be run from cron for producing |"
echo "| official nightly builds. It will mail responsible engineers |"
echo "| if any build failure occurs, sends build reports to v"
echo "| RE and update web pages."
echo "|"
echo "| Don't run it unless you know what you are doing. Thanks."
echo "|"
echo "| Mail gnome-re@sun.com if you need more info."
echo "\`------> +"
exit 1
fi
MYNAME="$0"
if [ "x$1" != x ]; then
SPECDIR="$1"
else
fi
# remove temporary files on exit
/tmp/cron-script.copy.* )
;;
esac
exit
}
# make a copy of the cron script in /tmp and execute that in order to
# avoid disasters caused by cvs update.
/tmp/cron-script.copy.* )
;;
*)
cd /tmp
;;
esac
echo "ERROR: $*"
exit 1
}
#revert any local changes
# checkout-out SVN copy *MUST* be read-only, or "update" needs passwd
cd $SPECDIR
# if the script changed during cvs update, restart with the updated script
# uninstall all pkgs left behind by a previous build
# remove-gnome will now remove anything left from uninstall-pkgs in case
# or a packaging change for example
# if the log directory exists, open a new one with numbered suffix
N=1
while [ -d $WEBROOT/$NEW_LOGDIR ]; do
N=`expr $N + 1`
done
# Rebuild the manpage tarballs
cd $SPECDIR
# start the build
pkgtool -v --nightly --date "$RELEASE_DATE" build closed/SUNWevolution-bdb-devel.spec closed/*.spec *.spec \
--prodname="${PRODNAME}/s${OSrel}${OSarch}" \
--define "nightly 1" \
# the number of failed pkgs is returned
FAILED=$?
# rotate rpms dir
# make dist
/sgnome/tools/re-scripts/jds-build/make-jds-dist.pl -l /sgnome/tools/re-scripts/jds-build/vermillion-devel.lst /jds/packages/PKGS /jds/dist nightly- > /dev/null 2>&1
# Disable deletion of nightly- dir as network area often full - this is backup.
export FAILED ALL_REPORTS
# update web page
# Report absolute symlinks. These are blockers for Solaris integration.
# Count the number of local patches.
# send warnings, errors and summary in email
# Email Beijing team to begin downloading packages.
/usr/bin/echo "*Date: `date '+%Y-%m-%d'`*\n${PRODNAME} S${OSrel} ${OSarch_full} Development nightly build finished: jdsserv.ireland:${RPMSDIR}/download" |
mailx -s "${PRODNAME} S${OSrel} ${OSarch_full} Development nightly build: $FAILED pkgs failed" "sunop@triathlon.prc.sun.com"
# find any differences from the prototype files saved after the
# last milestone build
echo $f:
echo
done > /tmp/proto-changes.$$
# if any diffs found mail the result to RE
( echo "Prototype changes found since the last milestone build:"
echo
cat /tmp/proto-changes.$$ ) | \
}
exit 0