-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1.14 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
.EXPORT_ALL_VARIABLES:
DIR=secrets
CONFIG_PATH=$(shell pwd)
GP = $(GOPATH)
CONFIG_DIR=${CONFIG_PATH}/${DIR}
.PHONY: init
init:
mkdir -p ${CONFIG_DIR}
echo ${GOPATH}
.PHONY: gencert
gencert:
${GOPATH}/bin/cfssl gencert -initca tls-config/ca-csr.json | ${GOPATH}/bin/cfssljson -bare ca
${GOPATH}/bin/cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=tls-config/ca-config.json \
-profile=server \
tls-config/server-csr.json | ${GOPATH}/bin/cfssljson -bare server
${GOPATH}/bin/cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=tls-config/ca-config.json \
-profile=client \
-cn="root" \
tls-config/client-csr.json | ${GOPATH}/bin/cfssljson -bare root-client
${GOPATH}/bin/cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=tls-config/ca-config.json \
-profile=client \
-cn="nobody" \
tls-config/client-csr.json | ${GOPATH}/bin/cfssljson -bare nobody-client
mv *.pem *.csr secrets
.PHONY: test
test:
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
cd internal/server && go test -v -debug=true
.PHONY: compile
compile:
protoc internal/log/proto/*.proto \
--go_out=plugins=grpc:.