Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
inline timestamp script
Browse files Browse the repository at this point in the history
Some of our jobs don't check out the substrate repo.
  • Loading branch information
Mira Ressel committed Mar 15, 2023
1 parent e6be50a commit 2f606ea
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
5 changes: 1 addition & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ 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:
- source scripts/ci/gitlab/timestamp.sh

.kubernetes-env:
image: "${CI_IMAGE}"
before_script:
Expand Down Expand Up @@ -316,6 +312,7 @@ include:
- local: scripts/ci/gitlab/default-pipeline.yml
rules:
- if: $PIPELINE != "automatic-crate-publishing"
- scripts/ci/gitlab/timestamp.yml

#### stage: notify

Expand Down
21 changes: 0 additions & 21 deletions scripts/ci/gitlab/timestamp.sh

This file was deleted.

27 changes: 27 additions & 0 deletions scripts/ci/gitlab/timestamp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.timestamp:
before_script:
- |
echo "Install timestamp handler"
eval '
# https://gist.github.com/altaua/477285db40181ef1793bbed5bae32c6b
# based on https://gist.github.com/jstine35/e0fc0e06ec06d74bc3ebd67585bf2a1d
s_datestamp() {
TZ=UTC
eof=""
while [[ -z "${eof}" ]]; do
IFS="" read -r line || eof=1
printf "[%(%F %T)T] %s\n" -1 "${line}"
done
}
cleanup() {
exec >/dev/null 2>&1
wait "${TIMESTAMP_PID}"
}
exec > >(s_datestamp) 2>&1
TIMESTAMP_PID=$!
trap cleanup EXIT
'

0 comments on commit 2f606ea

Please sign in to comment.