version 1.1.1.1, 2025/01/20 22:40:23
|
version 1.9, 2025/03/10 17:17:29
|
Line 44 then
|
Line 44 then
|
exit 1 |
exit 1 |
fi |
fi |
|
|
if [ $EUID -ne ${BUILDMAN_UID} ] |
#if [ $EUID -ne ${BUILDMAN_UID} ] |
then |
#then |
echo "${PROGN} error: must be run as user \"${BUILDMAN_USER}\"" |
# echo "${PROGN} error: must be run as user \"${BUILDMAN_USER}\"" |
exit 1 |
# exit 1 |
fi |
#fi |
|
|
ACTION="" |
ACTION="" |
PROJECT="" |
PROJECT="" |
BUILD_HOST="" |
BUILD_HOST="" |
OS=`uname` |
OS=`uname` |
|
PYES="no" |
|
|
if [ "$OS" = "SCO_SV" ] ; then |
if [ "$OS" = "SCO_SV" ] ; then |
THOST=`hostname -s` |
THOST=`hostname -s` |
Line 70 fi
|
Line 71 fi
|
tmphost=`echo ${THOST} | cut -d. -f1` |
tmphost=`echo ${THOST} | cut -d. -f1` |
THOST="${tmphost}" |
THOST="${tmphost}" |
|
|
|
while getopts ':p:h:a:bl:o:y' OPTION |
while getopts ':p:h:a:bl:o:' OPTION |
|
do |
do |
case $OPTION in |
case $OPTION in |
|
|
|
y) |
|
PYES="yes" |
|
;; |
|
|
l) |
l) |
ACTION="list" |
ACTION="list" |
TOLIST="${OPTARG}" |
TOLIST="${OPTARG}" |
Line 104 do
|
Line 108 do
|
esac |
esac |
done |
done |
|
|
|
if [ "${ACTION}" = "" ] |
|
then |
|
echo "${PROGN}: no action specified" |
|
exit 1 |
|
fi |
|
|
if [ ! -z "${PROJECT}" ] |
if [ ! -z "${PROJECT}" ] |
then |
then |
PROJECT_BASE="${BUILDMAN_BASE}/projects/${PROJECT}" |
PROJECT_BASE="${BUILDMAN_BASE}/projects/${PROJECT}" |
if [ "${ACTION}" == "add" -a ! -d ${PROJECT_BASE} ] |
if [ "${ACTION}" = "add" -a ! -d ${PROJECT_BASE} ] |
then |
then |
echo "$PROGN: creating ${PROJECT} in ${PROJECT_BASE}..." |
echo "$PROGN: creating ${PROJECT} in ${PROJECT_BASE}..." |
mkdir -p "${PROJECT_BASE}" |
mkdir -p "${PROJECT_BASE}" |
Line 115 then
|
Line 125 then
|
|
|
if [ ! -d "${PROJECT_BASE}" ] |
if [ ! -d "${PROJECT_BASE}" ] |
then |
then |
echo "$PROGN error: project ${PROJECT} not defined" |
echo "$PROGN error: project ${PROJECT} not defined [${PROJECT_BASE}]" |
exit 1 |
exit 1 |
fi |
fi |
fi |
fi |
Line 130 case $ACTION in
|
Line 140 case $ACTION in
|
;; |
;; |
|
|
h|hosts) |
h|hosts) |
ls -l "${BUILDMAN_BASE}/projects/${PROJECT}/hosts" |
BHOSTS=`ls -1 "${BUILDMAN_BASE}/projects/${PROJECT}/hosts"` |
|
for BHOST in ${BHOSTS} |
|
do |
|
echo ${BHOST} |
|
done |
;; |
;; |
|
|
*) |
*) |
Line 159 case $ACTION in
|
Line 173 case $ACTION in
|
|
|
echo "$PROGN: creating directory structure for project \"${PROJECT}\"" |
echo "$PROGN: creating directory structure for project \"${PROJECT}\"" |
mkdir -p "${PBASE}/hosts" |
mkdir -p "${PBASE}/hosts" |
|
mkdir -p "${PBASE}/scripts" |
;; |
;; |
|
|
|
|
Line 171 case $ACTION in
|
Line 185 case $ACTION in
|
fi |
fi |
|
|
PBASE="${BUILDMAN_BASE}/projects/${PROJECT}" |
PBASE="${BUILDMAN_BASE}/projects/${PROJECT}" |
|
|
if [ ! -d "${PBASE}" ] |
if [ ! -d "${PBASE}" ] |
then |
then |
echo "$PROGN error: project \"${PROJECT}\" does not exist" |
echo "$PROGN error: project \"${PROJECT}\" does not exist" |
Line 190 case $ACTION in
|
Line 205 case $ACTION in
|
exit 1 |
exit 1 |
fi |
fi |
|
|
|
if [ -z "${OPTIONS}" ] |
|
then |
|
echo "$PROGN error: must pass -o \"os:version:arch\"" |
|
exit 1 |
|
fi |
|
|
|
PLSTR="${BUILD_HOST}:${OPTIONS}:buildman::" |
|
H_PLATFORM=`echo ${PLSTR} | cut -d: -f2` |
|
H_VERSION=`echo ${PLSTR} | cut -d: -f3` |
|
H_ARCH=`echo ${PLSTR} | cut -d: -f4` |
|
|
|
if [ "${PYES}" = "no" ] |
|
then |
|
echo |
|
echo "Host Details" |
|
echo "============" |
|
echo "Project: ${PROJECT}" |
|
echo "Hostname: ${BUILD_HOST}" |
|
echo "Platform: ${H_PLATFORM}" |
|
echo "Version: ${H_VERSION}" |
|
echo "Architecture: ${H_ARCH}" |
|
echo |
|
|
|
read -n 1 -p "OK to create? (y/n) " YORN |
|
echo |
|
|
|
if [ "${YORN}" = "y" -o "${YORN}" = "Y" ] |
|
then |
|
CONF=1 |
|
else |
|
echo "$PROGN: aborted" |
|
exit 2 |
|
fi |
|
fi |
|
|
echo "$PROGN: adding host \"${BUILD_HOST}\" to project \"${PROJECT}\"" |
echo "$PROGN: adding host \"${BUILD_HOST}\" to project \"${PROJECT}\"" |
mkdir -p "${HBASE}" |
mkdir -p "${HBASE}" |
|
mkdir -p "${HBASE}/jobs" |
|
mkdir -p "${HBASE}/logs" |
|
|
|
PFILE="${PBASE}/${H_PLATFORM}-platform.list" |
|
echo |
|
echo "==================================================" |
|
echo " Don't forget to add the BuildMan cron job" |
|
echo " to ${BUILDMAN_USER}@${BUILD_HOST}" |
|
echo "==================================================" |
|
echo |
|
echo "${PLSTR}" >> "${PFILE}" |
|
cd ${PBASE} |
|
ls -1 *-platform.list | cut -d- -f1 | sort | uniq > platforms.list |
;; |
;; |
|
|
esac |
esac |
;; |
;; |
|
|
|
|
|
|
|
|
build) |
build) |
if [ -z "${BUILD_HOST}" ] |
if [ -z "${BUILD_HOST}" ] |
Line 206 case $ACTION in
|
Line 269 case $ACTION in
|
exit 1 |
exit 1 |
fi |
fi |
|
|
BUILD_BASE="${PROJECT_BASE}/hosts/${BUILD_HOST}" |
if [ "${BUILD_HOST}" != '*' ] |
|
then |
|
BUILD_BASE="${PROJECT_BASE}/hosts/${BUILD_HOST}" |
|
|
|
if [ ! -d "${BUILD_BASE}" ] |
|
then |
|
echo "$PROGN error: build host ${BUILD_HOST} not configured" |
|
exit 1 |
|
fi |
|
|
|
BUILD_WANTED="${PROJECT_BASE}/hosts/${BUILD_HOST}/build-wanted" |
|
|
if [ ! -d "${BUILD_BASE}" ] |
if [ -f "${BUILD_WANTED}" ] |
then |
then |
echo "$PROGN error: build host ${BUILD_HOST} not configured" |
echo "$PROGN error: build already requested on host ${BUILD_HOST}" |
exit 1 |
exit 1 |
fi |
fi |
|
|
BUILD_WANTED="${PROJECT_BASE}/${HOST}/build-wanted" |
|
|
|
if [ -f "${BUILD_WANTED}" ] |
touch "${BUILD_WANTED}" |
then |
echo "$PROGN: build of project ${PROJECT} requested on ${BUILD_HOST}" |
echo "$PROGN error: build already requested" |
else |
exit 1 |
BHOSTS=`ls -1 "${BUILDMAN_BASE}/projects/${PROJECT}/hosts"` |
|
for BUILD_HOST in ${BHOSTS} |
|
do |
|
BUILD_BASE="${PROJECT_BASE}/hosts/${BUILD_HOST}" |
|
|
|
if [ ! -d "${BUILD_BASE}" ] |
|
then |
|
echo "$PROGN error: build host ${BUILD_HOST} not configured" |
|
continue |
|
fi |
|
|
|
BUILD_WANTED="${PROJECT_BASE}/hosts/${BUILD_HOST}/build-wanted" |
|
|
|
if [ -f "${BUILD_WANTED}" ] |
|
then |
|
echo "$PROGN error: build already requested on ${BUILD_HOST}" |
|
continue |
|
fi |
|
|
|
touch "${BUILD_WANTED}" > /dev/null 2>&1 |
|
if [ $? = 0 ] |
|
then |
|
echo "$PROGN: build of project ${PROJECT} requested on build host ${BUILD_HOST}" |
|
else |
|
echo "$PROGN: error requesting build of ${PROJECT} on build host ${BUILD_HOST}" |
|
fi |
|
done |
fi |
fi |
|
|
touch "${BUILD_WANTED}" |
|
echo "$PROGN: build of project ${PROJECT} requested on build host ${HOST}" |
|
;; |
;; |
|
|
esac |
esac |
|
|
|
|
|
|
|
|