mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
ci: Fix date parsing with BusyBox on Alpine
This fixes the timestamps in Alpine containers. Signed-off-by: Valentine Burley <valentine.burley@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35051>
This commit is contained in:
parent
cc83b3db5f
commit
a6e1926a8e
1 changed files with 7 additions and 1 deletions
|
|
@ -33,7 +33,13 @@ function _error_msg() (
|
|||
echo -e "${RED}$*${ENDCOLOR}"
|
||||
)
|
||||
|
||||
export JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
|
||||
# Some date binaries (like the BusyBox one) use -D instead of -d for date parsing.
|
||||
# This fallback handles both cases: try GNU coreutils-style first, then fallback to BusyBox if it fails.
|
||||
# The BusyBox fallback needs '|| true' because it returns an error status even when it outputs the time.
|
||||
export JOB_START_S=$(
|
||||
date -u +"%s" -d "$CI_JOB_STARTED_AT" 2>/dev/null ||
|
||||
{ date -u +"%s" -D "%Y-%m-%dT%H:%M:%SZ" "$CI_JOB_STARTED_AT" 2>/dev/null || true; }
|
||||
)
|
||||
|
||||
function get_current_minsec {
|
||||
DATE_S=$(date -u +"%s")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue