diff --git a/Makefile b/Makefile index 4e22b2c5..5482f582 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ # If you can use docker without being root, you can do "make SUDO=" SUDO=sudo +WEAVE_VERSION=git-$(shell git rev-parse --short=12 HEAD) WEAVER_EXE=weaver/weaver WEAVEDNS_EXE=weavedns/weavedns WEAVER_IMAGE=zettio/weave @@ -15,7 +16,7 @@ all: $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVER_EXE) $(WEAVEDNS_EXE): go get -tags netgo ./$(shell dirname $@) - go build -ldflags '-extldflags "-static"' -tags netgo -o $@ ./$(shell dirname $@) + go build -ldflags '-extldflags "-static"' -ldflags "-X main.version $(WEAVE_VERSION)" -tags netgo -o $@ ./$(shell dirname $@) @strings $@ | grep cgo_stub\\\.go >/dev/null || { \ rm $@; \ echo "\nYour go standard library was built without the 'netgo' build tag."; \ diff --git a/bin/release b/bin/release index c0483a9f..749622f7 100755 --- a/bin/release +++ b/bin/release @@ -47,11 +47,9 @@ build() { ## Inject the version numbers and build the distributables ## (library versions?) - - sed -i "/var version = / c\var version = \"$VERSION\"" weaver/main.go - sed -i "/var version = / c\var version = \"$VERSION\"" weavedns/main.go sed -i "/SCRIPT_VERSION=/ c\SCRIPT_VERSION=\"$VERSION\"" ./weave make \ + WEAVE_VERSION=$VERSION \ WEAVER_IMAGE=$DOCKERHUB_USER/weave \ WEAVEDNS_IMAGE=$DOCKERHUB_USER/weavedns