-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
101 lines (76 loc) · 2.43 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
###################### Makefile ######################
#
# Edit this file with care, as it is also being used by our CI/CD Pipeline
# For usage information check README.md
#
# Parts of this makefile are based upon github.com/kolide/kit
#
export NAME := argument-analysis-research
export REPO := canonical-debate-lab
export GIT_HOST := github.com
export REGISTRY ?= eu.gcr.io
export PROJECT ?= argument-analysis-research
export RBE_PROJECT ?= argument-analysis-research
export PATH := $(GOPATH)/bin:$(PATH)
export NAMESPACE ?= research
-include .env
TEAMVAULT_SM ?= ~/.teamvault-sm.json
CMD ?= //...
include helpers/make_version
.PHONY: build
# test entire repo
gotest:
@go test -cover -race $(shell go list ./... | grep -v /vendor/)
test:
@go get github.com/onsi/ginkgo/ginkgo
@ginkgo -r -race
gazelle:
# bazel run //:gazelle
build: gazelle
bazel build --workspace_status_command=./helpers/status.sh $(CMD)
docker: gazelle
bazel run --workspace_status_command=./helpers/status.sh $(CMD):image -- --norun
push: gazelle
bazel run --workspace_status_command=./helpers/status.sh //:push
run: gazelle
bazel run \
--workspace_status_command=./helpers/status.sh $(CMD)
kube: gazelle
bazel run \
--verbose_failures \
--host_force_python=PY2 \
--workspace_status_command=./helpers/status.sh $(CMD)
# install passed in tool project
install:
GOBIN=$(GOPATH)/bin go install cmd/$(NAME)/*.go
# run specified tool from code
dev: generate
@go run -ldflags $(KIT_VERSION) cmd/$(NAME)/*.go \
-debug
# format entire repo (excluding vendor)
format:
@go get golang.org/x/tools/cmd/goimports
@find . -type f -name '*.go' -not -path './vendor/*' -exec gofmt -w "{}" +
@find . -type f -name '*.go' -not -path './vendor/*' -exec goimports -w "{}" +
clean:
bazel clean
# go quality checks
check: format lint vet
# vet entire repo (excluding vendor)
vet:
@go vet $(shell go list ./... | grep -v /vendor/)
# lint entire repo (excluding vendor)
lint:
@go get github.com/golang/lint/golint
@golint -min_confidence 1 $(shell go list ./... | grep -v /vendor/)
# errcheck entire repo (excluding vendor)
errcheck:
@go get github.com/kisielk/errcheck
@errcheck -ignore '(Close|Write)' $(shell go list ./... | grep -v /vendor/)
cover:
@go get github.com/haya14busa/goverage
@go get github.com/schrej/godacov
goverage -v -coverprofile=coverage.out $(shell go list ./... | grep -v /vendor/)
generate:
@go get github.com/maxbrunsfeld/counterfeiter
@go generate ./...