-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
70 lines (50 loc) · 1.39 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
SHELL = /bin/bash
SERVICES = \
backend/api/gateway \
backend/svc/greeter \
backend/svc/echo \
.PHONY: all
all: pre proto fmt lint
.PHONY: install
install:
make -C .devcontainer install
.PHONY: pre
pre:
@for f in $(SERVICES); do make -C $$f pre; done
.PHONY: fmt
fmt:
@for f in $(SERVICES); do make -C $$f fmt; done
.PHONY: lint
lint:
@for f in $(SERVICES); do make -C $$f lint; done
.PHONY: proto
proto:
buf mod update
buf generate
.PHONY: build
build:
skaffold build
.PHONY: kind
kind:
kind get clusters -q | grep "skeleton" || kind create cluster --config kind.yaml
.PHONY: clean
clean:
kind delete cluster --name skeleton
.PHONY: dev
dev:
skaffold dev
.PHONY: deploy-production
deploy-production:
docker login ghcr.io
skaffold run -p production
.PHONY: destroy-production
destroy-production:
skaffold delete -p production
.PHONY: http
http:
curl -i localhost:58080/greeter/v1/hello -H "Content-Type: application/json" -d '{"name": "alice"}'
curl -i localhost:58080/echo/v1/echo -H "Content-Type: application/json" -d '{"msg": "hoge"}'
.PHONY: grpc
grpc:
grpcurl -protoset <(buf build -o -) -plaintext -rpc-header 'dapr-app-id: svc-greeter' -d '{"name": "alice"}' localhost:50001 skeleton.greeter.v1.Greeter/Hello || true
grpcurl -protoset <(buf build -o -) -plaintext -rpc-header 'dapr-app-id: svc-echo' -d '{"msg": "hoge"}' localhost:50001 skeleton.echo.v1.Echo/Echo || true