From 71fc7c8742aa8459023c42a5765b4aee19e4307c Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 1 Aug 2022 15:29:14 +0200 Subject: [PATCH] chore: inject build info on development build --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b6c10b8..9f45dcc 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,15 @@ lint: ## Lint sources code build: build-frmd ## Build artefacts build-frmd: deps tailwind ## Build executable - CGO_ENABLED=0 go build -v -o ./bin/frmd ./cmd/frmd + CGO_ENABLED=0 go build \ + -v \ + -ldflags "\ + -X 'main.GitRef=$(shell git rev-parse --short HEAD)' \ + -X 'main.ProjectVersion=$(shell git describe --always)' \ + -X 'main.BuildDate=$(shell date --utc --rfc-3339=seconds)' \ + " \ + -o ./bin/frmd \ + ./cmd/frmd .PHONY: tailwind tailwind: deps