-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (31 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.DEFAULT_GOAL := help
TEST_FLAGS ?= -race
PKG_BASE ?= $(shell go list .)
PKGS ?= $(shell go list ./... | grep -v /vendor/)
.PHONY: help
help:
@grep -E '^[a-zA-Z0-9-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "[32m%-10s[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## build kickoff
go build \
-ldflags "-s -w \
-X $(PKG_BASE)/internal/version.gitVersion=$(shell git describe --tags 2>/dev/null || echo v0.0.0-master) \
-X $(PKG_BASE)/internal/version.gitCommit=$(shell git rev-parse HEAD) \
-X $(PKG_BASE)/internal/version.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" \
./cmd/kickoff
.PHONY: install
install: build ## install kickoff
cp kickoff $(GOPATH)/bin
.PHONY: test
test: ## run tests
go test $(TEST_FLAGS) $(PKGS)
.PHONY: vet
vet: ## run go vet
go vet $(PKGS)
.PHONY: coverage
coverage: ## generate code coverage
go test $(TEST_FLAGS) -covermode=atomic -coverprofile=coverage.txt $(PKGS)
go tool cover -func=coverage.txt
.PHONY: lint
lint: ## run golangci-lint
golangci-lint run