aboutsummaryrefslogtreecommitdiff
path: root/contrib/cirrus/lib.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-01-17 14:04:24 -0500
committerChris Evich <cevich@redhat.com>2019-01-17 14:32:28 -0500
commit7124ef71b566bbcdf0faa77961e90ab6ff0f03c5 (patch)
tree609c584419393044331b48d39ad788b243171586 /contrib/cirrus/lib.sh
parent0e3264ae4de85d2c974106582f80fd8cadab8bb8 (diff)
downloadpodman-7124ef71b566bbcdf0faa77961e90ab6ff0f03c5.tar.gz
podman-7124ef71b566bbcdf0faa77961e90ab6ff0f03c5.tar.bz2
podman-7124ef71b566bbcdf0faa77961e90ab6ff0f03c5.zip
cirrus: Record start/end time of important things
Previously we only reported the date/time at the beginning of a run since it's not available in the Cirrus-CI system. This commit generalizes the solution, recording start/end times for all major events. Also the timestamps are recorded into a local file on the VMs. This is intended for future use, for example tracking execution-time trends. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/lib.sh')
-rw-r--r--contrib/cirrus/lib.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index d50c1e1a3..32b2c91a5 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -17,7 +17,7 @@ PACKER_BASE=${PACKER_BASE:-./contrib/cirrus/packer}
CIRRUS_BUILD_ID=${CIRRUS_BUILD_ID:-DEADBEEF} # a human
CIRRUS_BASE_SHA=${CIRRUS_BASE_SHA:-HEAD}
CIRRUS_CHANGE_IN_REPO=${CIRRUS_CHANGE_IN_REPO:-FETCH_HEAD}
-START_STAMP_FILEPATH="${START_STAMP_FILEPATH:-/var/tmp/start.timestamp}"
+TIMESTAMPS_FILEPATH="${TIMESTAMPS_FILEPATH:-/var/tmp/timestamps}"
if ! [[ "$PATH" =~ "/usr/local/bin" ]]
then
@@ -136,11 +136,14 @@ ircmsg() {
set -e
}
-start_timestamp() {
- req_env_var "START_STAMP_FILEPATH $START_STAMP_FILEPATH"
- [[ -r "$START_STAMP_FILEPATH" ]] || \
- echo -e ".\nThe time at the tone will be:\n$(date --iso-8601=seconds | \
- tee $START_STAMP_FILEPATH)\nBLEEEEEEEEEEP!\n.\n" # Cirrus strips blank lines from output
+record_timestamp() {
+ set +x # sometimes it's turned on
+ req_env_var "TIMESTAMPS_FILEPATH $TIMESTAMPS_FILEPATH"
+ echo "." # cirrus webui strips blank-lines
+ STAMPMSG="The $1 time at the tone will be:"
+ echo -e "$STAMPMSG\t$(date --iso-8601=seconds)" | \
+ tee -a $TIMESTAMPS_FILEPATH
+ echo -e "BLEEEEEEEEEEP!\n."
}
# Run sudo in directory with GOPATH set