mirror of
https://github.com/coredns/coredns.git
synced 2025-12-05 01:45:11 -05:00
Add git commit to the version output. (#900)
Now the output would be:
```
./coredns -version
CoreDNS-010
linux/amd64, go1.8, 241e3db
```
In case the local file has been modified, then the output would be (with --dirty):
```
./coredns -version
CoreDNS-010
linux/amd64, go1.8, 241e3db-dirty
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
4
Makefile
4
Makefile
@@ -1,3 +1,5 @@
|
||||
GITCOMMIT := $(shell git describe --dirty --always)
|
||||
|
||||
BUILD_VERBOSE := -v
|
||||
|
||||
TEST_VERBOSE := -v
|
||||
@@ -8,7 +10,7 @@ all: coredns
|
||||
# TODO: Add .go file dependencies.
|
||||
.PHONY: coredns
|
||||
coredns: check godeps
|
||||
CGO_ENABLED=0 go build $(BUILD_VERBOSE) -ldflags="-s -w"
|
||||
CGO_ENABLED=0 go build $(BUILD_VERBOSE) -ldflags="-s -w -X github.com/coredns/coredns/coremain.gitCommit=$(GITCOMMIT)"
|
||||
|
||||
.PHONY: deps
|
||||
deps: core/zmiddleware.go core/dnsserver/zdirectives.go godeps
|
||||
|
||||
Reference in New Issue
Block a user