-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 871 Bytes
/
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
WORKSPACE = $(shell git rev-parse --show-toplevel)
SERVER-VERSION = 0.1
CLIENT-VERSION = 0.1
.PHONY: all
all: server client
.PHONY: proto
proto:
protoc --go_out=./zkp ./zkp/proto/*.proto
.PHONY: client
client: proto
go build -o=./build/client ./client/main.go
.PHONY: server
server: proto
go build -o=./build/server ./server/main.go
.PHONY: clean
clean:
rm -rf ./build
rm -rf ./zkp/gen
.PHONY: test
test: proto
go test ./...
.PHONY: coverage
coverage: proto
go test -cover ./...
.PHONY: server-image
server-image: server
docker build -t "zkp-server:$(SERVER-VERSION)" -f "server/docker/Dockerfile" $(WORKSPACE)
.PHONY: client-image
client-image: client
docker build -t "zkp-client:$(CLIENT-VERSION)" -f "client/docker/Dockerfile" $(WORKSPACE)
.PHONY: run-server
run-server: server-image
docker run -it --rm -p 8080:8080 "zkp-server:$(SERVER-VERSION)"