Browse Source

Publish build logs to git

Instead of publishing the results to a private mailing list, publish the
results to git.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
github-issue:	#7
master
Shawn Webb 9 months ago
parent
commit
7074494ffa
Signed by: shawn.webb <shawn.webb@hardenedbsd.org> GPG Key ID: FF2E67A277F8E1FA
4 changed files with 52 additions and 25 deletions
  1. +28
    -21
      bin/ci.sh
  2. +2
    -1
      lib/config.sh
  3. +20
    -1
      lib/log.sh
  4. +2
    -2
      lib/publish.sh

+ 28
- 21
bin/ci.sh View File

@@ -41,6 +41,31 @@ TOPDIR=$(get_topdir ${0})
. ${TOPDIR}/../lib/publish.sh
. ${TOPDIR}/../lib/util.sh

perform_build() {
local forcebuild
forcebuild=${1}

assert_unlocked && lock_build

update_codebase || return ${?}

if ! should_build ${forcebuild}; then
unlock_build
return 0
fi

clean_build && \
build_hardenedbsd && \
build_release && \
stage_release && \
sign_release && \
publish_release && \
kick_publisher_tires && \
cache_codebase_hashish && \
unlock_build
return ${?}
}

main() {
local self
local forcebuild
@@ -65,27 +90,9 @@ main() {

config_set_dynamic

(
assert_unlocked && lock_build

update_codebase || exit ${?}

if ! should_build ${forcebuild}; then
unlock_build
exit 0
fi

clean_build && \
build_hardenedbsd && \
build_release && \
stage_release && \
sign_release && \
publish_release && \
kick_publisher_tires && \
cache_codebase_hashish && \
unlock_build
exit ${?}
) | build_log 2>&1
perform_build ${forcebuild} | build_log 2>&1

publish_log

return ${?}
}


+ 2
- 1
lib/config.sh View File

@@ -25,6 +25,7 @@
# SUCH DAMAGE.

config_set_defaults() {
HBSD_BUILD_NAME="CURRENT.amd64.amd64"
HBSD_GPG_KEY=""
#HBSD_GPG_KEY="BB53388D3BD9892815CB9E30819B11A26FFD188D"
HBSD_INDEX_FILE=/build/index
@@ -37,7 +38,7 @@ config_set_defaults() {
HBSD_TARGET=amd64
HBSD_TARGET_ARCH=amd64
HBSD_NOCLEAN="-DNO_CLEAN"
HBSD_LOGDIR=/build/logs/13-current.amd64
HBSD_LOGDIR=/build/logs
HBSD_KEEP_NBUILDS=10
HBSD_CACHEDIR=/build/cache/13-current.amd64



+ 20
- 1
lib/log.sh View File

@@ -35,5 +35,24 @@ log_err() {
}

build_log() {
tee ${HBSD_BUILD_LOG} 2>&1
local log

log="${HBSD_LOGDIR}/builds/${HBSD_BUILD_NAME}/${HBSD_BUILDNUMBER}.log"
tee ${log}
}

publish_log() {
local log

log="${HBSD_LOGDIR}/builds/${HBSD_BUILD_NAME}/${HBSD_BUILDNUMBER}.log"

(
cd ${HBSD_LOGDIR}
git add ${log}
git commit -m "BUILD: ${HBSD_BUILD_NAME}/${HBSD_BUILDNUMBER}.log"
git push
exit ${?}
)

return ${?}
}

+ 2
- 2
lib/publish.sh View File

@@ -41,12 +41,12 @@ kick_publisher_tires() {

[ -z "${HBSD_MIRROR_MASTER}" ] && return 0

rsync -a ${HBSD_PUBDIR}/${HBSD_BUILDNUMBER}/ \
rsync -va ${HBSD_PUBDIR}/${HBSD_BUILDNUMBER}/ \
${HBSD_MIRROR_MASTER}:${HBSD_MIRROR_PUBDIR}/build-${HBSD_BUILDNUMBER}/
res=${?}
[ ${res} -gt 0 ] && return ${res}

rsync -a ${HBSD_PUBDIR}/BUILD-LATEST \
rsync -va ${HBSD_PUBDIR}/BUILD-LATEST \
${HBSD_MIRROR_MASTER}:${HBSD_MIRROR_PUBDIR}/
return ${?}
}

Loading…
Cancel
Save