Unverified Commit b1b9109a authored by Shawn Webb's avatar Shawn Webb
Browse files

Centralize logging and ensure sane build number



Ensure full build logs are always persisted. The new build_number
function always increments the build number index, so we need to cache
it at the earliest possible moment in main. Thus, build_number should
only be called once and only once.
Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent 97a1456a
......@@ -25,6 +25,7 @@
# SUCH DAMAGE.
. ./lib/build.sh
. ./lib/log.sh
. ./lib/publish.sh
. ./lib/util.sh
......@@ -40,17 +41,23 @@ main() {
HBSD_TARGET=amd64
HBSD_TARGET_ARCH=amd64
HBSD_NOCLEAN="-DNO_CLEAN"
HBSD_LOGDIR=/build/logs/13-current.amd64
assert_unlocked && \
lock_build && \
update_codebase && \
build_hardenedbsd && \
build_release && \
stage_release && \
sign_release && \
publish_release && \
kick_publisher_tires && \
unlock_build
HBSD_BUILDNUMBER=$(build_number)
HBSD_BUILD_LOG=${HBSD_LOGDIR}/${HBSD_BUILDNUMBER}.log
(
assert_unlocked && \
lock_build && \
update_codebase && \
build_hardenedbsd && \
build_release && \
stage_release && \
sign_release && \
publish_release && \
kick_publisher_tires && \
unlock_build
) | build_log
return ${?}
}
......
......@@ -30,6 +30,10 @@ log_info() {
}
log_err() {
logger -p usr.err HBSDBUILD_ERROR: $*
logger -p user.err HBSDBUILD_ERROR: $*
return ${?}
}
build_log() {
tee ${HBSD_BUILD_LOG} 2>&1
}
......@@ -25,7 +25,7 @@
# SUCH DAMAGE.
publish_release() {
mv ${HBSD_STAGEDIR} ${HBSD_PUBDIR}/$(build_number)
mv ${HBSD_STAGEDIR} ${HBSD_PUBDIR}/${HBSD_BUILDNUMBER}
return ${?}
}
......
......@@ -51,6 +51,7 @@ assert_unlocked() {
return 0
}
# The build_number function must be called EXACTLY ONCE.
build_number() {
local n
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment