Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ variables:
before_script:
- if echo "$CI_DISABLED_JOBS" | grep -xF "$CI_JOB_NAME"; then echo "The job has been cancelled in CI settings"; exit 0; fi

.timestamp:
before_script:
- if [ -z ${TIMESTAMP_DISABLED} ]; then source scripts/ci/gitlab/timestamp.sh; fi

.kubernetes-env:
image: "${CI_IMAGE}"
before_script:
- !reference [.timestamp, before_script]
- !reference [.job-switcher, before_script]
- !reference [.prepare-env, before_script]
tags:
Expand Down Expand Up @@ -141,6 +146,7 @@ variables:
.docker-env:
image: "${CI_IMAGE}"
before_script:
- !reference [.timestamp, before_script]
- !reference [.job-switcher, before_script]
- !reference [.prepare-env, before_script]
- !reference [.rust-info-script, script]
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/gitlab/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
GIT_STRATEGY: none
DOCKERFILE: $PRODUCT.Dockerfile
IMAGE_NAME: docker.io/$IMAGE_PATH
TIMESTAMP_DISABLED: "true"
before_script:
- !reference [.kubernetes-env, before_script]
- cd ./artifacts/$PRODUCT/
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ test-linux-stable-int:
WASM_BUILD_RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
# TIMESTAMP_DISABLED: "true"
script:
- rusty-cachier snapshot create
- WASM_BUILD_NO_COLOR=1
Expand Down
20 changes: 20 additions & 0 deletions scripts/ci/gitlab/timestamp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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)