From 53b300edd8cb6a27f1c24271b8b320de4f08f5a5 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 1 May 2021 00:20:11 -0700 Subject: [PATCH] add git version for local builds --- docker/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/Makefile b/docker/Makefile index a933956b7..58d494b95 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -5,7 +5,9 @@ all: gen gen: dev binary: - cd ../weed; CGO_ENABLED=0 GOOS=linux go build -ldflags "-extldflags -static"; mv weed ../docker/ + export SWCOMMIT=$(shell git rev-parse --short HEAD) + export SWLDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(SWCOMMIT)" + cd ../weed; CGO_ENABLED=0 GOOS=linux go build -ldflags "-extldflags -static $(SWLDFLAGS)"; mv weed ../docker/ build: binary docker build --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.local .