diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82599a4b84956..1a40b3bbd9882 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -275,7 +275,6 @@ variables: # Feature flags FF_SCRIPT_SECTIONS: 1 # Prevent multiline scripts log collapsing, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3392 FF_KUBERNETES_HONOR_ENTRYPOINT: true # Honor the entrypoint in the Docker image when running Kubernetes jobs - FF_TIMESTAMPS: true # # Condition mixins for simplification of rules diff --git a/.gitlab/source_test/macos.yml b/.gitlab/source_test/macos.yml index 1a92a354d47b8..e5ab655a0df54 100644 --- a/.gitlab/source_test/macos.yml +++ b/.gitlab/source_test/macos.yml @@ -9,6 +9,7 @@ include: variables: TEST_OUTPUT_FILE: test_output.json script: + - source timestamp.sh - !reference [.retrieve_linux_go_deps] - !reference [.retrieve_linux_go_tools_deps] - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH diff --git a/timestamp.sh b/timestamp.sh new file mode 100644 index 0000000000000..4bd4e08cc288c --- /dev/null +++ b/timestamp.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Original script from: https://gist.github.com/jstine35/e0fc0e06ec06d74bc3ebd67585bf2a1d +# By @jstine35 on GitHub + +s_datestamp() { + while read -r line; do + timestamp=$(date -u '+%Y-%m-%d %H:%M:%S') + + # by nature BASH might run process subst twice when using >&2 pipes. This is a lazy + # way to avoid dumping two timestamps on the same line: + if [[ "$line" != \[${timestamp%% *}* ]]; then + echo "[$timestamp] $line" + else + echo "$line" + fi + done +} + +exec 1> >(s_datestamp) +exec 2> >(s_datestamp)