summaryrefslogtreecommitdiff
path: root/workhorse/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/Makefile')
-rw-r--r--workhorse/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/workhorse/Makefile b/workhorse/Makefile
index 2bfaf5913c6..0e8c47ae35c 100644
--- a/workhorse/Makefile
+++ b/workhorse/Makefile
@@ -6,7 +6,12 @@ VERSION_STRING := $(shell git describe)
ifeq ($(strip $(VERSION_STRING)),)
VERSION_STRING := v$(shell cat VERSION)
endif
-BUILD_TIME := $(shell date -u +%Y%m%d.%H%M%S)
+DATE_FMT = +%Y%m%d.%H%M%S
+ifdef SOURCE_DATE_EPOCH
+ BUILD_TIME := $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
+else
+ BUILD_TIME := $(shell date -u "$(DATE_FMT)")
+endif
GOBUILD := go build -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)"
EXE_ALL := gitlab-resize-image gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
INSTALL := install