forked from meshery/meshery-osm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (52 loc) · 1.5 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
GOPATH = $(shell go env GOPATH)
protoc-setup:
cd meshes
wget https://raw.githubusercontent.com/layer5io/meshery/master/meshes/meshops.proto
check: error
golangci-lint run
check-clean-cache:
golangci-lint cache clean
proto:
protoc -I meshes/ meshes/meshops.proto --go_out=plugins=grpc:./meshes/
docker:
docker build -t layer5/meshery-osm .
docker-run:
(docker rm -f meshery-osm) || true
docker run --name meshery-osm -d \
-p 10009:10009 \
-e DEBUG=true \
layer5/meshery-osm
run:
DEBUG=true GOPROXY=direct GOSUMDB=off go run main.go
# setup-adapter sets up a new adapter with the given name & port
setup-adapter:
mv "osm" ${ADAPTER}
find . -type f -exec sed -i '' -e 's/osm/${ADAPTER}/g' {} +
find . -type f -exec sed -i '' -e 's/<port>/${PORT}/g' {} +
find . -type f -exec sed -i '' -e 's/<go_version>/${GO_VERSION}/g' {} +
.PHONY: local-check
local-check: tidy
local-check: go-fmt
local-check: go-vet
local-check: golangci-lint
.PHONY: go-fmt
go-fmt:
go fmt ./...
.PHONY: go-vet
go-vet:
go vet ./...
.PHONY: tidy
tidy:
@echo "Executing go mod tidy"
go mod tidy
.PHONY: golangci-lint
golangci-lint: $(GOLANGCILINT)
@echo
$(GOPATH)/bin/golangci-lint run
.PHONY: error
error:
go run github.com/layer5io/meshkit/cmd/errorutil -d . update -i ./helpers -o ./helpers
$(GOLANGCILINT):
(cd /; GO111MODULE=on GOPROXY="direct" GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/[email protected])
error:
go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./helpers -o ./helpers