# 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$
# Determine whether to do debug or non-debug build.
# On 'even' days of the week (Sun, Tues, Thur, Sat) to a debug build.
#if [ $DOW -eq "0" ]; then
# DEBUG_BUILD="--with-debug"
# DEBUG_DIR=.dbg
#fi
OSarch_full=`uname -p`
if [ "x$OSarch_full" = "xsparc" ]; then
OSarch=s
else
OSarch=x
fi
GNOME_VER="2.30"
PRODNAME="G${GNOME_VER}"
# 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
# check which subversion should be used
else
fi
# ------------ 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
}
# Uninstall and cleanup spec-files packages.
# copy libsqlite3.so to make svn cmd worked
if [ -f /THIS_IS_JAIL_* -a \
fi
#revert any local changes
# checkout-out SVN copy *MUST* be read-only, or "update" needs passwd
# if the script changed during cvs update, restart with the updated script
cd $SPECDIR
# uninstall all pkgs left behind by a previous build
pkgtool uninstall-pkgs --nonotify --with-svr4 --with-l10n --download --without-dt --with-indiana-branding --without-blueprint --define 'jds_version JDS4' --define 'support_level supported' specs/*.spec
# 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
cd $SPECDIR
#FIXME: The smf service could not run correctly in jail, hack the script here.
if [ -f /THIS_IS_JAIL_* ]; then
# remove libsqlite.so* that are manually copied when jail is created.
# build SUNWdesktop-cache.spec and SUNWsqlite3.spec at beginning
egrep -v '^(Requires|BuildRequires):' specs/SUNWdesktop-cache.spec > specs/SUNWdesktop-cache.spec.tmp.$$
pkgtool build --nonotify --with-l10n --with-svr4 ${DEBUG_BUILD} --define "nightly 1" --with-indiana-branding --define 'support_level supported' specs/SUNWdesktop-cache.spec.tmp.$$ specs/SUNWsqlite3.spec specs/SUNWgnome-xml.spec
# upload log file
# build gnome-xml separately. It creates an smf manifest which generates some
# docbook manifests. Generate them manually since this won't work in a jail.
#FIXME: The smf service could not run correctly in jail, hack desktop-cache smf script here.
else
su<<EO_SU
cat<<EOF>/usr/share/desktop-cache/restart_fmri
#!/bin/ksh
exit 0
EOF
EO_SU
fi
fi
# start the build
--download \
--prodname="${PRODNAME}/s${OSrel}${OSarch}" \
--define 'support_level supported' \
# the number of failed pkgs is returned
FAILED=$?
#FIXME: Rebuild SUNWdesktop-cache a regular one at the end
if [ -f /THIS_IS_JAIL_* ]; then
pkgtool build-only --nonotify --with-l10n --with-svr4 ${DEBUG_BUILD} --define "nightly 1" --with-indiana-branding --define 'support_level supported' specs/SUNWdesktop-cache.spec
fi
# 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 --nightly /jds/packages/PKGS /jds/dist nightly- > /dev/null 2>&1
# Send output of make-jds-dist.pl to GNOME RE for review.
/sgnome/tools/re-scripts/jds-build/make-jds-dist.pl -l /sgnome/tools/re-scripts/jds-build/vermillion-devel.lst --nightly /jds/packages/PKGS /jds/dist nightly- -dryrun 2>&1 | \
mailx -s "${PRODNAME} S${OSrel} ${OSarch_full} nightly build: make-jds-dist.pl output" "gnome-re@sun.com"
# 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,sunop@mhw.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