We're making the build logic more complicated, better have a real
script file to read it in good conditions.
Will also less the log look better, showing build args instead of printf
before the collapsed section.
Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
- !reference [.debian-build-template,before_script]
- printf "\e[0Ksection_end:$(date +%s):before_script[collapsed=true]\r\e[0K\n"
script:
+ # let git-rebase run the build for each commit
- git rebase --rebase-merges $CI_MERGE_REQUEST_DIFF_BASE_SHA
- --exec 'printf "\e[0Ksection_start:$(date +%s):commit-$(git rev-parse --short HEAD)[collapsed=true]\r\e[0K\e[1;33m$(git log -1 --oneline)\e[1;0m\n"'
- --exec "cargo build ${FEATURES} ${CARGO_FLAGS}"
- --exec 'printf "\e[0Ksection_end:$(date +%s):commit-$(git rev-parse --short HEAD)\r\e[0K\n"'
+ --exec 'devscripts/gitlab-ci-runbuild.sh cargo build ${FEATURES} ${CARGO_FLAGS}'
build-linux:
parallel: !reference [.featurematrix,parallel]
--- /dev/null
+#!/bin/sh
+set -e
+
+# all error output to stdout, so shell tracing markers are kept in
+# suitable ordering with collapsable section markers
+exec 2>&1
+
+FOOTER_ID="commit-$(git rev-parse --short HEAD)"
+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"
+# trace, but not outside of collapsed section
+set -x
+
+"$@"
+
+# stop traces before closing collapsed section
+set +x
+# collapsable footer
+printf "\e[0Ksection_end:$(date +%s):${FOOTER_ID}\r\e[0K\n"