ci: convert the job start date into a timestamp only once

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28344>
This commit is contained in:
Eric Engestrom 2024-03-22 17:25:59 +00:00 committed by Marge Bot
parent 775eca9449
commit ed45e373bf
1 changed files with 2 additions and 1 deletions

View File

@ -14,9 +14,10 @@ function x_off {
# TODO: implement x_on !
export JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
function get_current_minsec {
DATE_S=$(date -u +"%s")
JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
CURR_TIME=$((DATE_S-JOB_START_S))
echo "$(printf "%02d" $((CURR_TIME/60))):$(printf "%02d" $((CURR_TIME%60)))"
}