#!/bin/bash die() { echo "error: $@"; exit 1; } BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf : ${SVN_HOME="/home/tjoke/svn/smage/trunk"} [ -e ${QUEUEDIR} ] || die "queue '${QUEUEFILE}' does not exist" for id in $(find ${QUEUEDIR} -mindepth 1 -printf '%f\n' | sort -V) do smage="$(< ${QUEUEDIR}/${id})" case ${smage} in '#') continue ;; "") continue ;; esac FULLPATH_SMAGEFILE="${SVN_HOME}/${smage}" if [[ -e ${FULLPATH_SMAGEFILE} ]] then ${BUILDSERVER_LIB_DIR}/runme.sh ${smage} || die "build failed" # remove from queue ${BUILDSERVER_LIB_DIR}/queue-del.sh -n "${id}" else die "smagefile '${FULLPATH_SMAGEFILE}' does not exist" fi done