-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
79 lines (64 loc) · 1.69 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
CONFIG_PATH=${HOME}/workspace/golang/distributed-logging-storage-practice/config-path-test
.PHONY: init
init:
mkdir -p ${CONFIG_PATH}
.PHONY: install
install:
go mod tidy
.PHONY: gencert
gencert: init
cfssl gencert -initca test/ca-csr.json | cfssljson -bare ca
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=test/ca-config.json \
-profile=client test/client-csr.json | cfssljson -bare client
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=test/ca-config.json \
-profile=server test/server-csr.json | cfssljson -bare server
# Client 1
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=test/ca-config.json \
-profile=client \
-cn="nobody" \
test/client-csr.json | cfssljson -bare nobody-client
# Client 2
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=test/ca-config.json \
-cn="root" \
-profile=client test/client-csr.json | cfssljson -bare root-client
mv *.pem *.csr ${CONFIG_PATH}
$(CONFIG_PATH)/model.conf:
cp test/model.conf $(CONFIG_PATH)/model.conf
$(CONFIG_PATH)/policy.csv:
cp test/policy.csv $(CONFIG_PATH)/policy.csv
.PHONY: test
test: gencert $(CONFIG_PATH)/model.conf $(CONFIG_PATH)/policy.csv
go test ./... -race
.PHONY: debug-test
debug-test:
cd ./internal/server && go test -v -debug=true
# Reflect에 의한 동적 컴파일 template 생성
.PHONY: compile
compile:
protoc api/v1/*.proto \
--go_out=. \
--go-grpc_out=. \
--go_opt=paths=source_relative \
--go-grpc_opt=paths=source_relative \
--proto_path=.
# DOCKER BUILD
TAG ?=0.0.1
.PHONY: docker-build
docker-build:
docker build -t 1eedaegon/dlsp:${TAG} .
# DOCKER PUSH
.PHONY: docker-push
docker-push:
docker push 1eedaegon/dlsp:${TAG}