chore: inject build info on development build

This commit is contained in:
wpetit 2022-08-01 15:29:14 +02:00 committed by Bornholm
parent b2f744578f
commit 71fc7c8742
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