52 lines
1.1 KiB
Makefile
52 lines
1.1 KiB
Makefile
CONFIG_PATH=${HOME}/.proglog/
|
|
|
|
.PHONY: init
|
|
init:
|
|
mkdir -p $(CONFIG_PATH)
|
|
|
|
.PHONY: gencert
|
|
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/server-csr.json | cfssljson -bare server
|
|
|
|
cfssl gencert \
|
|
-ca=ca.pem \
|
|
-ca-key=ca-key.pem \
|
|
-config=certs/ca-config.json \
|
|
-profile=client \
|
|
certs/client-csr.json | cfssljson -bare root-client
|
|
|
|
cfssl gencert \
|
|
-ca=ca.pem \
|
|
-ca-key=ca-key.pem \
|
|
-config=certs/ca-config.json \
|
|
-profile=client \
|
|
certs/client-csr.json | cfssljson -bare nobody-client
|
|
|
|
mv *.pem *.csr $(CONFIG_PATH)
|
|
|
|
.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=.
|
|
|
|
$(CONFIG_PATH)/model.conf: test/model.conf
|
|
cp test/model.conf $(CONFIG_PATH)/model.conf
|
|
|
|
$(CONFIG_PATH)/policy.csv: test/policy.csv
|
|
cp test/policy.csv $(CONFIG_PATH)/policy.csv
|
|
|
|
.PHONY: test
|
|
test: $(CONFIG_PATH)/model.conf $(CONFIG_PATH)/policy.csv
|
|
go test -race ./...
|