X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build.sh;h=a77b4098f7ecc573700adba64c8045182ead9c0b;hb=6ed9da1b3f72c8ae4da299052a343c0f96d57ec5;hp=2247dba4b2ddae7c461d2fcfadf49d586287b985;hpb=81c2fcc1d4b71ba9b2623bf1a9901c628bdc7661;p=build.git diff --git a/build.sh b/build.sh index 2247dba4..a77b4098 100755 --- a/build.sh +++ b/build.sh @@ -4,26 +4,28 @@ # crontabs to build nightly releases (default). Can also be invoked # manually to build a tagged release (-r) in the current directory. # -# $Id: build.sh,v 1.18 2004/10/30 16:01:03 mlhuang Exp $ +# Mark Huang +# Copyright (C) 2003-2005 The Trustees of Princeton University +# +# $Id: build.sh,v 1.30 2005/05/04 20:34:59 mlhuang Exp $ # # Set defaults -CVSROOT=:pserver:anon@build.planet-lab.org:/cvs +CVSROOT=:pserver:anon@cvs.planet-lab.org:/cvs CVS_RSH=ssh MODULE=build TAG=HEAD BASE=$PWD +MAKEFILE=Makefile -# Alpha node repository -ALPHA_BOOT=build@boot.planet-lab.org -ALPHA_ROOT=/www/planetlab/install-rpms/archive/planetlab-alpha -ALPHA_RPMS=/www/planetlab/install-rpms/planetlab-alpha +# cron does not set USER? +[ -z "$USER" ] && export USER=$LOGNAME # Export certain variables export CVS_RSH # Get options -while getopts "d:r:m:b:x:h" opt ; do +while getopts "d:r:m:f:b:x:h" opt ; do case $opt in d) CVSROOT=$OPTARG @@ -34,6 +36,9 @@ while getopts "d:r:m:b:x:h" opt ; do m) MAILTO=$OPTARG ;; + f) + MAKEFILE=$OPTARG + ;; b) BASE=$OPTARG ;; @@ -51,6 +56,7 @@ while getopts "d:r:m:b:x:h" opt ; do ;; esac done +shift $(($OPTIND - 1)) # Base operations in specified directory mkdir -p $BASE @@ -80,7 +86,8 @@ exec &>${BASE}/log # Build cvs -d ${CVSROOT} export -r ${TAG} -d ${BASE} ${MODULE} -make -C ${BASE} +make -f ${MAKEFILE} -C ${BASE} && \ +make -f ${MAKEFILE} -C ${BASE} install BASE=$BASE BUILDS=$BUILDS rc=$? if [ $rc -ne 0 ] ; then @@ -91,23 +98,4 @@ if [ $rc -ne 0 ] ; then exit $rc fi -# Create package manifest -URLBASE=$(cd ${BASE} && pwd -P) -URLBASE="http://build.planet-lab.org/${URLBASE##$HOME/}/SRPMS" -${BASE}/packages.sh -b ${URLBASE} ${BASE}/SRPMS > ${BASE}/SRPMS/packages.xml - -# Usually only the nightly build specifies -x -if [ -n "$BUILDS" ] ; then - # Remove old nightly runs - echo "cd ${ALPHA_ROOT} && ls -t | sed -n ${BUILDS}~1p | xargs rm -rf" | ssh ${ALPHA_BOOT} /bin/bash -s - # Update alpha node repository - for i in RPMS SRPMS ; do - ssh ${ALPHA_BOOT} mkdir -p ${ALPHA_ROOT}/${BASE}/${i} - find ${BASE}/${i} -type f | xargs -i scp {} ${ALPHA_BOOT}:${ALPHA_ROOT}/${BASE}/${i} - ssh ${ALPHA_BOOT} yum-arch ${ALPHA_ROOT}/${BASE}/${i} >/dev/null - done - # Update symlink - ssh ${ALPHA_BOOT} ln -nsf ${ALPHA_ROOT}/${BASE}/RPMS/ ${ALPHA_RPMS} -fi - exit 0