Set build date on macos (#1849)

mine
Mat Schaffer 2022-12-03 11:41:48 -08:00 committed by GitHub
parent 3f280ca133
commit 82fecb9804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -4,7 +4,11 @@ OUTPUT_BIN ?= execs/${NAME}
PACKAGE := github.com/derailed/$(NAME)
GIT_REV ?= $(shell git rev-parse --short HEAD)
SOURCE_DATE_EPOCH ?= $(shell date +%s)
ifeq ($(shell uname), Darwin)
DATE ?= $(shell TZ=UTC date -j -f "%s" ${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ")
else
DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ")
endif
VERSION ?= v0.26.7
IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION}