aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Bechler <SQiShER@users.noreply.github.com>2015-12-17 16:06:58 +0100
committerDaniel Bechler <SQiShER@users.noreply.github.com>2016-01-06 23:54:33 +0100
commitfc3931c924511531fe252342489af9468394f2f1 (patch)
tree2bdb9b77254ac6a1e161c7c320d16d17c151ce72 /Makefile
parenta59c71b505736ca160a466f4637b156ac5d04ebd (diff)
downloadprometheus_node_collector-fc3931c924511531fe252342489af9468394f2f1.tar.bz2
prometheus_node_collector-fc3931c924511531fe252342489af9468394f2f1.tar.xz
prometheus_node_collector-fc3931c924511531fe252342489af9468394f2f1.zip
Add build_info metric similar to the one of Prometheus itself
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4849578..d0bf5de 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,16 @@
13 13
14VERSION := 0.12.0rc1 14VERSION := 0.12.0rc1
15TARGET := node_exporter 15TARGET := node_exporter
16GOFLAGS := -ldflags "-X main.Version=$(VERSION)" 16
17REVISION := $(shell git rev-parse --short HEAD 2> /dev/null || echo 'unknown')
18BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2> /dev/null || echo 'unknown')
19
20REPO_PATH := "github.com/prometheus/node_exporter"
21LDFLAGS := -X main.Version=$(VERSION)
22LDFLAGS += -X $(REPO_PATH)/collector.Version=$(VERSION)
23LDFLAGS += -X $(REPO_PATH)/collector.Revision=$(REVISION)
24LDFLAGS += -X $(REPO_PATH)/collector.Branch=$(BRANCH)
25
26GOFLAGS := -ldflags "$(LDFLAGS)"
17 27
18include Makefile.COMMON 28include Makefile.COMMON