forked from openservicemesh/osm-health
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (47 loc) · 1.37 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
#!make
VERSION ?= dev
BUILD_DATE=$$(date +%F)
GIT_SHA=$$(git rev-parse HEAD)
BUILD_DATE_VAR := github.com/openservicemesh/osm-health/pkg/version.BuildDate
BUILD_VERSION_VAR := github.com/openservicemesh/osm-health/pkg/version.Version
BUILD_GITCOMMIT_VAR := github.com/openservicemesh/osm-health/pkg/version.GitCommit
LDFLAGS ?= "-X $(BUILD_DATE_VAR)=$(BUILD_DATE) -X $(BUILD_VERSION_VAR)=$(VERSION) -X $(BUILD_GITCOMMIT_VAR)=$(GIT_SHA) -s -w"
.PHONY: build-ci
build-ci: build-osm-health
.PHONY: build
build: build-osm-health
.PHONY: build-osm-health
build-osm-health:
CGO_ENABLED=0 go build -v -o ./bin/osm-health -ldflags ${LDFLAGS} ./cmd
.PHONY: go-checks
go-checks: go-lint go-fmt go-mod-tidy check-mocks
.PHONY: go-vet
go-vet:
go vet ./...
.PHONY: go-lint
go-lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint run --config .golangci.yml
.PHONY: go-fmt
go-fmt:
go fmt ./...
.PHONY: go-mod-tidy
go-mod-tidy:
./scripts/go-mod-tidy.sh
.PHONY: go-test
go-test:
./scripts/go-test.sh
.PHONY: go-test-coverage
go-test-coverage:
./scripts/test-w-coverage.sh
.PHONY: shellcheck
shellcheck:
shellcheck -x $(shell find . -name '*.sh')
.PHONY: install-git-pre-push-hook
install-git-pre-push-hook:
./scripts/install-git-pre-push-hook.sh
.PHONY: run-collection
run-collection: build-osm-health
./bin/osm-health collect
.PHONY: kind-up
kind-up:
./scripts/kind-with-registry.sh