|
|
| version 1.5, 2025/03/05 17:23:59 | version 1.6, 2025/03/12 02:31:46 |
|---|---|
| Line 92 do | Line 92 do |
| JOBDIR="${HOSTDIR}/jobs/${JOBID}" | JOBDIR="${HOSTDIR}/jobs/${JOBID}" |
| JLOG="${JOBDIR}/job.log" | JLOG="${JOBDIR}/job.log" |
| JSCR="${BUILDMAN_BASE}/projects/${PROJECT}/scripts/build.sh" | JSCR="${BUILDMAN_BASE}/projects/${PROJECT}/scripts/build.sh" |
| PRESCR="${HOSTDIR}/prebuild.sh" | |
| POSTSCR="${HOSTDIR}/postbuild.sh" | |
| mkdir -p "${JOBDIR}" | mkdir -p "${JOBDIR}" |
| cd "${JOBDIR}" | cd "${JOBDIR}" |
| Line 101 do | Line 103 do |
| echo "${JOBID}" > "${HOSTDIR}/build-running" | echo "${JOBID}" > "${HOSTDIR}/build-running" |
| echo "${JOBID}" > "${JOBDIR}/running" | echo "${JOBID}" > "${JOBDIR}/running" |
| if [ -f "${PRESCR}" ] | |
| then | |
| echo "$PROGN: running host-specific prebuild script ${PRESCR} for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" | |
| echo "$PROGN: running host-specific prebuild script ${PRESCR} for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" >> ${JLOG} | |
| sh "${PRESCR}" >> ${JLOG} | |
| RETCODE=$? | |
| if [ $RETCODE -gt 0 ] | |
| then | |
| echo "$PROGN: host-specific prebuild script failed for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" | |
| echo "$PROGN: host-specific prebuild script failed for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" >> ${JLOG} | |
| rm -f "${HOSTDIR}/build-running" | |
| rm -f "${JOBDIR}/running" | |
| rm -f "${HOSTDIR}/build-failing" | |
| rm -f "${HOSTDIR}/build-passing" | |
| echo "${JOBID}" > "${HOSTDIR}/build-failing" | |
| echo "${JOBID}" > "${JOBDIR}/failing" | |
| exit 1 | |
| fi | |
| else | |
| echo "$PROGN: no host-specific prebuild script exists for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" | |
| echo "$PROGN: no host-specific prebuild script exists for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" >> ${JLOG} | |
| fi | |
| if [ -f "${JSCR}" ] | if [ -f "${JSCR}" ] |
| then | then |
| echo "$PROGN: running build script ${JSCR} for project ${PROJECT} [job id ${JOBID}]" | echo "$PROGN: running build script ${JSCR} for project ${PROJECT} [job id ${JOBID}]" |
| echo "$PROGN: running build script ${JSCR} for project ${PROJECT} [job id ${JOBID}]" >> ${JLOG} | |
| sh "${JSCR}" >> ${JLOG} | sh "${JSCR}" >> ${JLOG} |
| RETCODE=$? | RETCODE=$? |
| Line 123 do | Line 153 do |
| *) | *) |
| echo "${JOBID}" > "${HOSTDIR}/build-failing" | echo "${JOBID}" > "${HOSTDIR}/build-failing" |
| echo "${JOBID}" > "${JOBDIR}/failing" | echo "${JOBID}" > "${JOBDIR}/failing" |
| exit 1 | |
| ;; | ;; |
| esac | esac |
| Line 133 do | Line 164 do |
| echo "$PROGN: build script ${JSCR} missing for project ${PROJECT} [job id ${JOBID}]" >> "${JLOG}" | echo "$PROGN: build script ${JSCR} missing for project ${PROJECT} [job id ${JOBID}]" >> "${JLOG}" |
| rm -f "${HOSTDIR}/build-running" | rm -f "${HOSTDIR}/build-running" |
| rm -f "${JOBDIR}/running" | rm -f "${JOBDIR}/running" |
| fi | |
| if [ -f "${POSTSCR}" ] | |
| then | |
| echo "$PROGN: running host-specific postbuild script ${POSTSCR} for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" | |
| echo "$PROGN: running host-specific postbuild script ${POSTSCR} for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" >> ${JLOG} | |
| sh "${POSTSCR}" >> ${JLOG} | |
| RETCODE=$? | |
| if [ $RETCODE -gt 0 ] | |
| then | |
| echo "$PROGN: host-specific postbuild script failed for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" | |
| echo "$PROGN: host-specific postbuild script failed for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" >> ${JLOG} | |
| rm -f "${HOSTDIR}/build-running" | |
| rm -f "${JOBDIR}/running" | |
| rm -f "${HOSTDIR}/build-failing" | |
| rm -f "${HOSTDIR}/build-passing" | |
| echo "${JOBID}" > "${HOSTDIR}/build-failing" | |
| echo "${JOBID}" > "${JOBDIR}/failing" | |
| exit 1 | |
| fi | |
| else | |
| echo "$PROGN: no host-specific postbuild script exists for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" | |
| echo "$PROGN: no host-specific postbuild script exists for project ${PROJECT} on host ${THOST} [job id ${JOBID}]" >> ${JLOG} | |
| fi | fi |
| fi | fi |
| fi | fi |