forked from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
132 lines (105 loc) · 4.4 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
ADAPTER_URLS := "mesherylocal.layer5.io:10000 mesherylocal.layer5.io:10001 mesherylocal.layer5.io:10002 mesherylocal.layer5.io:10003 mesherylocal.layer5.io:10004 mesherylocal.layer5.io:10008"
MESHERY_CLOUD_LOCAL=http://mesherylocal.layer5.io:9876
MESHERY_CLOUD_DEV=http://localhost:9876
MESHERY_CLOUD_PROD=https://meshery.layer5.io
MESHERY_CLOUD_STAGING=https://staging-meshery.layer5.io
# Build the CLI for Meshery - `mesheryctl`.
# Build Meshery inside of a multi-stage Docker container.
mesheryctl:
cd mesheryctl; go build -o mesheryctl cmd/mesheryctl/main.go
DOCKER_BUILDKIT=1 docker build -t layer5/meshery .
# `make docker` builds Meshery inside of a multi-stage Docker container.
# This method does NOT require that you have Go, NPM, etc. installed locally.
docker:
DOCKER_BUILDKIT=1 docker build -t layer5/meshery --build-arg TOKEN=$(GLOBAL_TOKEN) .
# Runs Meshery in a container locally and points to locally-running
# Meshery Cloud for user authentication.
docker-run-local-cloud:
(docker rm -f meshery) || true
docker run --name meshery -d \
--link meshery-cloud:meshery-cloud \
-e SAAS_BASE_URL=$(MESHERY_CLOUD_LOCAL) \
-e DEBUG=true \
-e ADAPTER_URLS=$(ADAPTER_URLS) \
-p 9081:8080 \
layer5/meshery ./meshery
# Runs Meshery in a container locally and points to remote
# Meshery Cloud for user authentication.
docker-run-cloud:
(docker rm -f meshery) || true
docker run --name meshery -d \
-e SAAS_BASE_URL=$(MESHERY_CLOUD_PROD) \
-e DEBUG=true \
-e ADAPTER_URLS=$(ADAPTER_URLS) \
-v meshery-config:/home/appuser/.meshery/config \
-v $(HOME)/.kube:/home/appuser/.kube:ro \
-p 9081:8080 \
layer5/meshery ./meshery
# Runs Meshery on your local machine and points to locally-running
# Meshery Cloud for user authentication.
run-local-cloud:
cd cmd; go clean; rm meshery; go mod tidy; go build -tags draft -a -o meshery; \
SAAS_BASE_URL=$(MESHERY_CLOUD_DEV) \
PORT=9081 \
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
./meshery; \
cd ..
# Builds and runs Meshery to run on your local machine.
# and points to remote Meshery Cloud for user authentication.
run-local:
cd cmd; go clean; rm meshery; go mod tidy; go build -tags draft -a -o meshery; \
SAAS_BASE_URL=$(MESHERY_CLOUD_PROD) \
PORT=9081 \
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
./meshery; \
cd ..
run-tests:
GO111MODULE=off GOPROXY=direct GOSUMDB=off go get github.com/mgechev/revive;
$(GOPATH)/bin/revive -config tools-config/revive-lint.toml -formatter friendly ./... \
GOPROXY=direct GOSUMDB=off GO111MODULE=off go get github.com/kisielk/errcheck;
$(GOPATH)/bin/errcheck -tags draft ./... \
GOPROXY=direct GOSUMDB=off GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck;
$(GOPATH)/bin/staticcheck -tags draft -checks all,-ST1003,-ST1000,-U1000 ./... \
GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./... \
GO111MODULE=off go get github.com/securego/gosec/cmd/gosec;
$(GOPATH)/bin/gosec -exclude=G301,G304,G107 ./...
proto:
# go get -u google.golang.org/grpc
# go get -u github.com/golang/protobuf/protoc-gen-go
# PATH=$(PATH):`pwd`/../protoc/bin:$(GOPATH)/bin
# export PATH=$PATH:`pwd`/../protoc/bin:$GOPATH/bin
protoc -I meshes/ meshes/meshops.proto --go_out=plugins=grpc:./meshes/
# Installs dependencies for building the user interface.
setup-ui-libs:
cd ui; npm i; cd ..
cd provider-ui; npm i; cd ..
# Runs the Meshery UI interface on your local machine.
run-ui-dev:
cd ui; npm run dev; cd ..
# Runs the Provider UI interface on your local machine.
run-provider-ui-dev:
cd provider-ui; npm run dev; cd ..
# Runs the lint on Meshery UI interface on your local machine.
run-ui-lint:
cd ui; npm run lint; cd ..
# Runs the lint on Meshery UI interface on your local machine.
run-provider-ui-lint:
cd provider-ui; npm run lint; cd ..
# Builds all user interfaces on your local machine.
build-ui:
cd ui; npm run build && npm run export; cd ..
cd provider-ui; npm run build && npm run export; cd ..
# setup wrk2 for local dev
# NOTE: setup-wrk does not work on Mac Catalina at the moment
setup-wrk2:
cd cmd; git clone [email protected]:layer5io/wrk2.git; cd wrk2; make; cd ..
#Incorporating Make docs commands from the Docs Makefile
jekyll=bundle exec jekyll
docs:
$(jekyll) serve --drafts --livereload
build-docs:
$(jekyll) build --drafts --livereload
docker-docs:
docker run --name meshery-docs --rm -p 4000:4000 -v `pwd`:"/srv/jekyll" jekyll/jekyll:3.8.5 bash -c "bundle install; jekyll serve --drafts --livereload"