cms-template/Makefile

21 lines
594 B
Makefile
Raw Normal View History

DATE?=$(shell date -u "+%Y-%m-%d %H:%M:%S")
LDFLAGS=-s -w -X 'main.AppVersion=${app_version}' -X 'main.BuildDate=${DATE}'
LDFLAGS=-X 'main.AppVersion=${app_version}' -X 'main.BuildDate=${DATE}'
GOPATH=$(shell go env GOPATH)
.PHONY: build
build:
GOWORK=off CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -gcflags=-trimpath=$(GOPATH) -asmflags=-trimpath=$(GOPATH) -trimpath -mod=readonly -o bin/cms-template
.PHONY: test
test:
go test -mod=readonly -race -v ./... -cover
.PHONY: generate
generate:
go generate ./...
.PHONY: docker
docker:
docker build -v $(CURDIR):/build -t cms-template .