-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (50 loc) · 1.19 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
.PHONY: compile
compile:
protoc api/v1/*.proto \
--gogo_out=\
Mgogoproto/gogo.proto=github.com/gogo/protobuf/proto,plugins=grpc:. \
--proto_path=\
$$(go list -f '{{ .Dir }}' -m github.com/gogo/protobuf) \
--proto_path=.
CONFIG_PATH=${HOME}/.ledger
.PHONY: init
init:
mkdir -p ${CONFIG_PATH}
cp test/model.conf $(CONFIG_PATH)/model.conf
cp test/policy.csv $(CONFIG_PATH)/policy.csv
.PHONY: gencert
gencert:
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=server \
test/server-csr.json | cfssljson -bare server
# END: begin
# START: client
cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=test/ca-config.json \
-profile=client \
-cn="root" \
test/client-csr.json | cfssljson -bare root-client
# END: client
# START: client
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
# END: client
mv *.pem *.csr ${CONFIG_PATH}
.PHONY: test
test:
go test -race ./...
TAG ?= 0.0.1
build-docker:
docker build -t github.com/vxio/ledger:$(TAG) .