From: Yann Dirson Date: Fri, 1 Dec 2023 09:57:38 +0000 (+0100) Subject: ci: make sure collapsed-section footer is always printed X-Git-Tag: 0.3.0~13^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f8e2a3290bb239156c6e3af7b40fad3cd686b5ca;p=xen-guest-agent.git ci: make sure collapsed-section footer is always printed In case of error the lack of footer would fool gitlab log display into thinking error summary from git-rebase was part of the collapsible section, which is confusing to the reader. Signed-off-by: Yann Dirson --- diff --git a/devscripts/gitlab-ci-runbuild.sh b/devscripts/gitlab-ci-runbuild.sh index ce60a70..474bda1 100755 --- a/devscripts/gitlab-ci-runbuild.sh +++ b/devscripts/gitlab-ci-runbuild.sh @@ -11,6 +11,9 @@ COLLAPSED_TITLE="$(git log -1 --oneline)" # collapsable header printf "\e[0Ksection_start:$(date +%s):${FOOTER_ID}[collapsed=true]\r\e[0K\e[1;33m${COLLAPSED_TITLE}\e[1;0m\n" +# collapsable footer, stopping traces first +trap 'set +x; printf "\e[0Ksection_end:$(date +%s):${FOOTER_ID}\r\e[0K\n"' EXIT + # trace, but not outside of collapsed section set -x @@ -29,10 +32,5 @@ else esac fi -# stop traces before closing collapsed section -set +x -# collapsable footer -printf "\e[0Ksection_end:$(date +%s):${FOOTER_ID}\r\e[0K\n" - # make any ignored error visible outside of collapsed section [ $IGNORED_ERROR = 0 ] || printf "\e[1;31mIgnoring failure for WIP commit\e[1;0m\n"