3 # PlanetLab devbox release script. Intended to be used by scripts and
4 # crontabs to build nightly releases (default).
6 # $Id: devbox.sh,v 1.4 2005/09/21 18:57:53 mef Exp $
10 CVSROOT=:pserver:anon@cvs.planet-lab.org:/cvs
16 # Export certain variables
21 while getopts "d:r:m:b:x:h" opt ; do
38 echo "usage: `basename $0` [OPTION]..."
39 echo " -d directory CVS repository root (default $CVSROOT)"
40 echo " -r revision CVS revision to checkout (default $TAG)"
41 echo " -m address Notify recipient of failures (default: none)"
42 echo " -b base Run operations in specified base directory (default $BASE)"
48 # Base operations in specified directory
49 if [ -z "$BASE" ]; then
50 BASE=`mktemp -d /tmp/DEVBOX.XXXXXX` || { echo $"could not make temp file" >& 2; exit 1; }
56 # Redirect output from here
58 exec &>${BASE}/${DAT}/devbox.log
63 # Upload packages to boot server
64 SERVER=build@boot.planet-lab.org
65 REPOSITORY=/var/www/html/install-rpms
67 for RELEASE in devbox alpha-devbox beta-devbox ; do
68 TMPDEVBOXRELEASE=planetlab-${RELEASE}_${DAT}_tmp
69 DEVBOXRELEASE=planetlab-${RELEASE}
71 ssh $SERVER mkdir -p ${REPOSITORY}/${TMPDEVBOXRELEASE}
72 if [ $? -ne 0 ] ; then
73 echo "ERROR: mkdir -p ${REPOSITORY}/${TMPDEVBOXRELEASE} failed"
76 BUILT=$(echo $DEVBOXRELEASE | sed "s,\-devbox,,")
77 ssh $SERVER ln -nf ${REPOSITORY}/$BUILT/*.rpm ${REPOSITORY}/${TMPDEVBOXRELEASE}
79 mkdir -p ${BASE}/${DAT}/${DEVBOXRELEASE}
80 install -D -m 644 ${DAT}/groups/${RELEASE}_yumgroups.xml ${BASE}/${DAT}/${DEVBOXRELEASE}/yumgroups.xml
81 scp ${BASE}/${DAT}/${DEVBOXRELEASE}/yumgroups.xml ${SERVER}:${REPOSITORY}/${TMPDEVBOXRELEASE}/yumgroups.xml
83 ssh $SERVER rm -rf ${REPOSITORY}/${DEVBOXRELEASE}-old
84 ssh $SERVER mv ${REPOSITORY}/${DEVBOXRELEASE} ${REPOSITORY}/${DEVBOXRELEASE}-old
85 ssh $SERVER mv ${REPOSITORY}/${TMPDEVBOXRELEASE} ${REPOSITORY}/${DEVBOXRELEASE}
86 ssh $SERVER rm -rf ${REPOSITORY}/${DEVBOXRELEASE}-old
88 ssh $SERVER yum-arch ${REPOSITORY}/${DEVBOXRELEASE} >/dev/null
89 ssh $SERVER createrepo -g yumgroups.xml ${REPOSITORY}/${DEVBOXRELEASE} >/dev/null