From c42155dc7d5dfd68b0dd2e27937fec90c6f804fa Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Tue, 4 Aug 2020 19:02:12 +0200 Subject: [PATCH] Make probe builder failures non-fatal The probe builder still returns non-zero exit code, but only after trying to build all probes. Results from all failed builds are logged again at the end of the output for easier investigation. --- probe-builder/build-probe-binaries | 76 ++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/probe-builder/build-probe-binaries b/probe-builder/build-probe-binaries index e0c6389b64..c10998b8c4 100755 --- a/probe-builder/build-probe-binaries +++ b/probe-builder/build-probe-binaries @@ -34,6 +34,8 @@ RETRIES=10 DOWNLOAD_TIMEOUT=300 PROBE_VERSION= RUNNING_IN_DOCKER= +FAILED= +FAIL_LOG=$(mktemp /tmp/fail.log.XXXXXX) usage() { cat >&2 < $LOG + then + (echo "Build for $PROBE_ID failed"; cat $LOG) | tee -a $FAIL_LOG + FAILED=1 + else + echo "Build for $PROBE_ID successful" + cat $LOG + fi + rm -f $LOG } function coreos_build { @@ -990,6 +1013,19 @@ case "$KERNEL_TYPE" in ;; esac -echo "Success." +if [ -s "$FAIL_LOG" ] +then + echo "Failed builds:" + echo "------------------------------" + cat $FAIL_LOG +fi +rm -f $FAIL_LOG +if [ -n "$FAILED" ] +then + echo "Build failed." + exit 1 +else + echo "Success." +fi # vim: :set tabstop=8 shiftwidth=8 noexpandtab: