-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (34 loc) · 1.04 KB
/
Makefile
File metadata and controls
50 lines (34 loc) · 1.04 KB
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
include .env
.EXPORT_ALL_VARIABLES:
GRPC_GW_PATH := $(shell go list -f '{{ .Dir }}' github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway)
APIS_PATH := "$(GRPC_GW_PATH)/../third_party/googleapis"
dev-server:
GRPC_GO_LOG_VERBOSITY_LEVEL=99
GRPC_GO_LOG_SEVERITY_LEVEL=info
go run -race cmd/server/server.go
dev-gw:
go run -race cmd/gw/gw.go
dev-cli:
go run -race cmd/cli/cli.go user create
prod:
CGO_ENABLED=0
go build -ldflags="-s -w" -o ./bin/server cmd/server/server.go
go build -ldflags="-s -w" -o ./bin/gw cmd/gw/gw.go
go build -ldflags="-s -w" -o ./bin/cli cmd/cli/cli.go
upx bin/server
upx bin/gw
upx bin/cli
test:
go test -race -cover ./...
update:
go get ./...
go mod tidy
pb:
@protoc -I ${APIS_PATH} -I proto/ proto/*.proto --go_out=plugins=grpc:proto
@protoc -I ${APIS_PATH} -I proto/ proto/*.proto --grpc-gateway_out=logtostderr=true:./proto
docker-build:
./docker.sh server
./docker.sh gw
docker-compose:
docker-compose up
.PHONY: dev-server dev-gw dev-cli prod test update pb docker-build docker-compose