chore: inject build info on development build

This commit is contained in:
wpetit 2022-08-01 15:29:14 +02:00
parent c59e7dba6b
commit 09de72f646
1 changed files with 9 additions and 1 deletions

View File

@ -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