-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (47 loc) · 1.64 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
PKG_PROTO_FILES=$(shell find go/pkg -name *.proto)
.PHONY: go-api-tools
go-api-tools:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest
go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest
.PHONY: go-pkg
go-pkg:
protoc --proto_path=./go/pkg \
--proto_path=./go/third_party \
--go_out=paths=source_relative:./go/pkg \
$(PKG_PROTO_FILES)
.PHONY: go-api
go-api: go-api-tools
find go/app -mindepth 1 -maxdepth 1 -type d -print | xargs -L 1 bash -c 'cd "$$0" && pwd && $(MAKE) api'
.PHONY: go-internal
go-internal: go-pkg
find go/app -mindepth 1 -maxdepth 1 -type d -print | xargs -L 1 bash -c 'cd "$$0" && pwd && $(MAKE) internal'
.PHONY: go-docker
go-docker: go-pkg go-api go-internal
find go/app -mindepth 1 -maxdepth 1 -type d -print | xargs -L 1 bash -c 'cd "$$0" && pwd && $(MAKE) docker'
.PHONY: py-api
py-api:
find python -mindepth 1 -maxdepth 1 -type d -print | xargs -L 1 bash -c 'cd "$$0" && pwd && $(MAKE) api'
.PHONY: py-docker
py-docker: py-api
find python -mindepth 1 -maxdepth 1 -type d -print | xargs -L 1 bash -c 'cd "$$0" && pwd && $(MAKE) docker'
.PHONY: internal
internal: go-internal
.PHONY: api
api: go-api py-api
.PHONY: docker
docker: go-docker py-docker
.PHONY: push
push: docker
docker push huangyingting/bg
docker push huangyingting/be
docker push huangyingting/bi
docker push huangyingting/bs
.PHONY: up
up:
docker-compose up -d
.PHONY: down
down:
docker-compose down