-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 865 Bytes
/
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
GO111MODULE?=on
CGO_ENABLED?=0
GOOS?=linux
GO_BIN?=app
GO?=go
GOFLAGS?=-ldflags=-w -ldflags=-s -a -buildvcs
UI_FOLDER?=
MICROK8S_REGISTRY_FLAG?=SKAFFOLD_DEFAULT_REPO=localhost:32000
SKAFFOLD?=skaffold
CONFIGMAP?=deployments/kubectl/configMap.yaml
.EXPORT_ALL_VARIABLES:
mocks: vendor
$(GO) install go.uber.org/mock/[email protected]
# generate gomocks
$(GO) generate ./...
.PHONY: mocks
test: mocks vet
$(GO) test ./... -cover -coverprofile coverage_source.out
# this will be cached, just needed to the test.json
$(GO) test ./... -cover -coverprofile coverage_source.out -json > test_source.json
cat coverage_source.out | grep -v "mock_*" | tee coverage.out
cat test_source.json | grep -v "mock_*" | tee test.json
.PHONY: test
vet:
$(GO) vet ./...
.PHONY: vet
vendor:
$(GO) mod vendor
.PHONY: vendor
build:
$(GO) build -o $(GO_BIN) ./
.PHONY: build