3 # PlanetLab release build script. Intended to be used by scripts and
4 # crontabs to build nightly releases (default). Can also be invoked
5 # manually to build a tagged release (-r) in the current directory.
7 # $Id: build.sh,v 1.10 2004/08/18 16:16:56 mlh-pl_rpm Exp $
11 CVSROOT=bui-pl_rpm@cvs.planet-lab.org:/cvs
16 # Alpha node repository
17 ALPHA_BOOT=build@boot.planet-lab.org
18 ALPHA_ROOT=/www/planetlab/install-rpms/archive/planetlab-alpha
19 ALPHA_RPMS=/www/planetlab/install-rpms/planetlab-alpha
21 # Export certain variables
25 while getopts "d:r:" opt ; do
34 echo "usage: `basename $0` [-d $CVSROOT] [-r $TAG]"
40 # Create a unique build base
41 BASE=${TAG/HEAD/`date +%Y.%m.%d`}
43 while ! mkdir ${BASE}${i} 2>/dev/null ; do
44 [ -z ${i} ] && BASE=${BASE}.
46 if [ $i -gt 100 ] ; then
47 echo "$0: Failed to create release directory `pwd`/${BASE}${i}"
55 # XXX Hack to store the pup key as well as the bui key
57 for i in `grep -l "BEGIN.*PRIVATE KEY" $HOME/.ssh/*` ; do
58 SSH_ASKPASS=/bin/false ssh-add $i
61 cvs -d ${CVSROOT} export -r ${TAG} -d ${BASE} ${MODULE}
65 if [ $? -ne 0 ] ; then
67 if [ -f ${BASE}/log ] ; then
72 elif [ "$TAG" = "HEAD" ] ; then
73 # Update alpha node repository
74 for i in RPMS SRPMS ; do
75 ssh ${ALPHA_BOOT} mkdir -p ${ALPHA_ROOT}/${BASE}/${i}
76 find ${BASE}/${i} -type f | xargs -i scp {} ${ALPHA_BOOT}:${ALPHA_ROOT}/${BASE}/${i}
77 ssh ${ALPHA_BOOT} yum-arch ${ALPHA_ROOT}/${BASE}/${i} >/dev/null
80 ssh ${ALPHA_BOOT} ln -nsf ${ALPHA_ROOT}/${BASE}/RPMS/ ${ALPHA_RPMS}
83 # Kill the current agent