Skip to content

Commit 10cba19

Browse files
committed
Merge remote-tracking branch 'assisted-by-ai/claude/automated-builder-diagnostics-Mq8Tn'
2 parents 5e3995a + c2223fa commit 10cba19

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

automated_builder/roles/gui-build/templates/build_vms_from_tag.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set -o errexit
55
set -o nounset
66
set -o pipefail
77
set -o errtrace
8+
shopt -s inherit_errexit
9+
shopt -s shift_verbose
810

911
readonly BUILD_LOG='/home/ansible/build.log'
1012

@@ -15,10 +17,11 @@ readonly BUILD_LOG='/home/ansible/build.log'
1517
on_exit() {
1618
local rc=$?
1719
if [ "${rc}" -ne 0 ] && [ -r "${BUILD_LOG}" ]; then
18-
printf '\n=== build_vms_from_tag.sh: failed (rc=%d). Tail of %s: ===\n' \
19-
"${rc}" "${BUILD_LOG}" >&2
20+
printf '%s\n' \
21+
"" \
22+
"=== build_vms_from_tag.sh: failed (rc=${rc}). Tail of '${BUILD_LOG}': ===" >&2
2023
tail --lines=200 -- "${BUILD_LOG}" >&2 || true
21-
printf '=== end of build.log tail ===\n' >&2
24+
printf '%s\n' '=== end of build.log tail ===' >&2
2225
fi
2326
exit "${rc}"
2427
}
@@ -35,7 +38,7 @@ main() {
3538
## Using 'pipefail' so a non-zero exit from build_command propagates
3639
## through the pipe.
3740
set -o pipefail
38-
build_command "$@" 2>&1 | tee -a -- "${BUILD_LOG}"
41+
build_command "$@" 2>&1 | tee --append -- "${BUILD_LOG}"
3942
}
4043

4144
build_command() {

0 commit comments

Comments
 (0)