You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
13
-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
14
-
go install github.com/envoyproxy/protoc-gen-validate@latest
15
-
go install github.com/srikrsna/protoc-gen-gotag@latest
16
-
go install community_gw/cmd/protoc-gen-go-gin@latest
17
-
go install community_gw/cmd/protoc-gen-go-rpc-tmpl@latest
18
-
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
19
-
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
20
-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
21
-
go install github.com/swaggo/swag/cmd/swag@latest
22
-
go install github.com/ofabry/go-callvis@latest
23
-
go install golang.org/x/pkgsite/cmd/pkgsite@latest
6
+
24
7
25
8
26
9
.PHONY: mod
@@ -60,12 +43,6 @@ cover:
60
43
go tool cover -html=cover.out
61
44
62
45
63
-
.PHONY: docs
64
-
# generate swagger docs, the host address can be changed via parameters, e.g. make docs HOST=192.168.3.37
65
-
docs: mod fmt
66
-
@bash scripts/swag-docs.sh $(HOST)
67
-
68
-
69
46
.PHONY: graph
70
47
# generate interactive visual function dependency graphs
71
48
graph:
@@ -75,10 +52,16 @@ graph:
75
52
@rm -f main.go community_gw.gv
76
53
77
54
55
+
.PHONY: docs
56
+
# generate swagger docs, only for ⓵ Web services created based on sql, the host address can be changed via parameters, e.g. make docs HOST=192.168.3.37
57
+
docs: mod fmt
58
+
@bash scripts/swag-docs.sh $(HOST)
59
+
60
+
78
61
.PHONY: proto
79
-
# generate *.pb.go codes from *.proto files
62
+
# generate *.go and template code by proto files, if you do not refer to the proto file, the default is all the proto files in the api directory. you can specify the proto file, multiple files are separated by commas, e.g. make proto FILES=api/user/v1/user.proto. only for ⓶ Microservices created based on sql, ⓷ Web services created based on protobuf, ⓸ Microservices created based on protobuf, ⓹ RPC gateway service created based on protobuf
80
63
proto: mod fmt
81
-
@bash scripts/protoc.sh
64
+
@bash scripts/protoc.sh$(FILES)
82
65
83
66
84
67
.PHONY: proto-doc
@@ -91,9 +74,7 @@ proto-doc:
91
74
# build community_gw for linux amd64 binary
92
75
build:
93
76
@echo "building 'community_gw', linux binary file will output to 'cmd/community_gw'"
94
-
@cd cmd/community_gw && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://goproxy.cn,direct go build
95
-
96
-
77
+
@cd cmd/community_gw && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
97
78
98
79
99
80
@@ -109,12 +90,30 @@ run-nohup:
109
90
@bash scripts/run-nohup.sh $(CMD)
110
91
111
92
112
-
.PHONY: docker-image
93
+
.PHONY: binary-package
94
+
# packaged binary files
95
+
binary-package: build
96
+
@bash scripts/binary-package.sh
97
+
98
+
99
+
.PHONY: deploy-binary
100
+
# deploy binary to remote linux server, e.g. make deploy-binary USER=root PWD=123456 IP=192.168.1.10
# push docker image to remote repositories, e.g. make image-push REPO_HOST=addr TAG=latest
138
131
image-push:
@@ -145,22 +138,28 @@ deploy-k8s:
145
138
@bash scripts/deploy-k8s.sh
146
139
147
140
148
-
.PHONY: deploy-docker
149
-
#deploy service to local docker, you must first run 'make docker-image' to generate a docker image, if you want to stop the server, pass the parameter stop, e.g. make deploy-docker CMD=stop
150
-
deploy-docker:
151
-
@bash scripts/deploy-docker.sh $(CMD)
141
+
.PHONY: image-build-rpc-test
142
+
#build rpc test image for remote repositories, e.g. make image-build-rpc-test REPO_HOST=addr TAG=latest
0 commit comments