File tree 4 files changed +14
-2
lines changed
4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ COPY . ./
30
30
COPY --from=lattice-builder /lattice/build /lattice
31
31
RUN /go/bin/statik -src=/lattice -dest=/pilosa
32
32
33
- ENV SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH
33
+ ENV SOURCE_DATE_EPOCH=${ SOURCE_DATE_EPOCH}
34
34
RUN make build FLAGS="-o build/featurebase" ${MAKE_FLAGS}
35
35
36
36
# ####################
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ GOOS=$(shell $(GO) env GOOS)
7
7
GOARCH =$(shell $(GO ) env GOARCH)
8
8
VERSION_ID =$(if $(TRIAL_DEADLINE ) ,trial-$(TRIAL_DEADLINE ) -,)$(VERSION ) -$(GOOS ) -$(GOARCH )
9
9
DATE_FMT ="+%FT%T%z"
10
+ # set SOURCE_DATE_EPOCH like this to use the last git commit timestamp
11
+ # export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) instead of the current time from running `date`
10
12
ifdef SOURCE_DATE_EPOCH
11
13
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)")
12
14
else
Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ COPY . .
23
23
24
24
ARG MAKE_FLAGS
25
25
ARG GO_BUILD_FLAGS
26
+ ARG SOURCE_DATE_EPOCH
26
27
27
28
WORKDIR /featurebase/idk/
28
29
30
+ ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}
29
31
RUN make build GO_BUILD_FLAGS="-mod=vendor ${GO_BUILD_FLAGS}" ${MAKE_FLAGS}
30
32
31
33
FROM ubuntu:20.04 as runner
Original file line number Diff line number Diff line change @@ -8,7 +8,14 @@ ODBC_ENABLED=
8
8
BINOUT ?= bin
9
9
VERSION := $(shell git describe --tags 2> /dev/null || git rev-parse --verify --short=7 HEAD)
10
10
VERSION_ID = $(VERSION ) -$(GOOS ) -$(GOARCH )
11
- BUILD_TIME := $(shell date -u +% FT% T% z)
11
+ DATE_FMT ="+%FT%T%z"
12
+ # set SOURCE_DATE_EPOCH like this to use the last git commit timestamp
13
+ # export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) instead of the current time from running `date`.
14
+ ifdef SOURCE_DATE_EPOCH
15
+ 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)")
16
+ else
17
+ BUILD_TIME ?= $(shell date -u "$(DATE_FMT)")
18
+ endif
12
19
AWS_ACCOUNTID ?= undefined
13
20
BRANCH_NAME ?= ""
14
21
@@ -271,6 +278,7 @@ docker-build: vendor
271
278
--build-arg GO_VERSION=$(GO_VERSION ) \
272
279
--build-arg MAKE_FLAGS=" GOOS=$( GOOS) GOARCH=$( GOARCH) BUILD_CGO=$( BUILD_CGO) " \
273
280
--build-arg GO_BUILD_FLAGS=$(GO_BUILD_FLAGS ) \
281
+ --build-arg SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
274
282
--target builder \
275
283
--tag idk:$(BUILD_NAME) ../.
276
284
mkdir -p build/idk-$(GOOS)-$(GOARCH)
You can’t perform that action at this time.
0 commit comments