5 CVSROOT=":pserver:anon@cvs.planet-lab.org:/cvs"
7 MAILTO="thierry.parmentelat@sophia.inria.fr"
11 # plc chroot runs in UTC
12 date=$(date -u +'%Y.%m.%d')
14 ### in the root context
15 function do_chroot () {
16 chroot /plc/devel/root su - build <<EOF
17 $CHROOTDIR/$COMMAND $@
21 # Notify recipient of failure
23 if [ -n "$MAILTO" ] ; then
24 tail -c 8k ${BUILD}/log-build.txt | mail -s "Failures for ${BUILD}" $MAILTO
30 if [ -n "$MAILTO" ] ; then
31 date | mail -s "Successfull build in ${BUILD}" $MAILTO
36 function create_base () {
37 BASE=${TAG/HEAD/`date +%Y.%m.%d`}
39 while ! mkdir ${BASE}${i} 2>/dev/null ; do
40 [ -z ${i} ] && BASE=${BASE}.
42 if [ $i -gt 100 ] ; then
43 echo "$0: Failed to create release directory `pwd`/${BASE}${i}"
50 function use_base () {
51 [ ! -d $BASE ] && mkdir $BASE
52 if [ ! -d $BASE ] ; then
53 echo $COMMAND failed to create base $BASE
62 echo -n "============================== Starting $COMMAND on "
68 cvs -d $CVSROOT co -d $BASE build
70 echo "Running make IN build $(pwd)"
71 make ${MAKEOPTS[@]} TAG=${TAG} PLDISTRO=${DISTRO} ${MAKEVARS[@]} -C $BASE $MAKETARGETS
80 function show_env () {
88 echo "Usage: $COMMAND [option] make-targets"
89 echo "Supported options"
96 echo " -s MAKEVAR=value - spaces in value are not supported"
97 echo " -n passed to make"
103 if [ -d /plc/devel/data ] ; then
108 while getopts "vd:r:m:f:b:s:nh" opt ; do
111 d) CVSROOT=$OPTARG ;;
116 s) MAKEVARS=(${MAKEVARS[@]} $OPTARG) ;;
117 n) MAILTO="" ; MAKEOPTS=(${MAKEOPTS[@]} -n) ;;
121 shift $(($OPTIND - 1))
127 # if specified, use it, otherwise create from date
128 if [ -z "$BASE" ] ; then
135 build >> ${BUILD}/log-build.txt 2>&1