mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
refactoring makefile, also adding test (#71)
This commit is contained in:
27
Makefile
27
Makefile
@@ -1,9 +1,24 @@
|
|||||||
pull:
|
DATE ?= $(shell date +%FT%T%z)
|
||||||
git pull
|
VERSION ?= $(git describe --tags --always --dirty --match=v* 2> /dev/null || \
|
||||||
|
cat $(CURDIR)/.version 2> /dev/null || echo "v0")
|
||||||
|
|
||||||
build:
|
.PHONY: test
|
||||||
go build -o bin/dashboard .
|
test: ; $(info $(M) start unit testing...) @
|
||||||
|
@go test $$(go list ./... | grep -v /mocks/) --race -v -short -coverprofile=profile.cov
|
||||||
|
@echo "\n*****************************"
|
||||||
|
@echo "** TOTAL COVERAGE: $$(go tool cover -func profile.cov | grep total | grep -Eo '[0-9]+\.[0-9]+')% **"
|
||||||
|
@echo "*****************************\n"
|
||||||
|
|
||||||
|
.PHONY: pull
|
||||||
|
pull: ; $(info $(M) Pulling source...) @
|
||||||
|
@git pull
|
||||||
|
|
||||||
debug:
|
.PHONY: build
|
||||||
DEBUG=1 ./bin/dashboard
|
build: $(BIN) ; $(info $(M) Building executable...) @ ## Build program binary
|
||||||
|
$Q $(GO) build \
|
||||||
|
-ldflags '-X main.version=$(VERSION) -X main.buildDate=$(DATE)' \
|
||||||
|
-o bin/dashboard .
|
||||||
|
|
||||||
|
.PHONY: debug
|
||||||
|
debug: ; $(info $(M) Running dashboard in debug mode...) @
|
||||||
|
@DEBUG=1 ./bin/dashboard
|
||||||
Reference in New Issue
Block a user