This repository has been archived by the owner on Dec 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
50 lines (41 loc) · 1.38 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
CONFIG_PATH=${HOME}/.hello/
all: init gencert build
init:
mkdir -p ${CONFIG_PATH}
build:
dep ensure
protoc --go_out=plugins=grpc:. hello/hello.proto
protoc --go_out=plugins=grpc:. auth/auth.proto
mkdir -p bin
go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o bin/auth-client ./cmd/auth-client
go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o bin/auth-server ./cmd/auth-server
go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o bin/hello-client ./cmd/hello-client
go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o bin/hello-server ./cmd/hello-server
gencert:
cfssl gencert \
-initca certs/ca-csr.json | cfssljson -bare ca
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=certs/ca-config.json \
-profile=server \
certs/hello-csr.json | cfssljson -bare hello
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=certs/ca-config.json \
-profile=server \
certs/auth-csr.json | cfssljson -bare auth
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=certs/ca-config.json \
-profile=client \
certs/client-csr.json | cfssljson -bare client
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=certs/ca-config.json \
-profile=signing \
certs/jwt-csr.json | cfssljson -bare jwt
mv *.pem *.csr ${CONFIG_PATH}