diff --git a/Makefile b/Makefile index d368953..415e2b2 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ .PHONY: all build clean -PROJECT_NAME = $(shell head -n1 go.mod | cut -d'/' -f2) - +PROJECT_NAME = $(shell head -n1 go.mod | cut -d'/' -f2) +VERSION ?= dev all: build # Build static executable build: - CGO_ENABLED=0 go build + CGO_ENABLED=0 go build -ldflags "-X main.VERSION=${VERSION}" strip $(PROJECT_NAME) clean: diff --git a/app_exporter.go b/app_exporter.go index ef46d36..44875ff 100644 --- a/app_exporter.go +++ b/app_exporter.go @@ -13,7 +13,8 @@ import ( "recycled.cloud/app-exporter/apps" ) -const VERSION = "0.1.0" +// var so it can be overridden at build time +var VERSION = "dev" const LISTEN_ADDR = ":9404" const INTERVAL = 24 * time.Hour