-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
43 lines (34 loc) · 1020 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
VERSION = v1.2.5
SOURCEDIR := .
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
PROTO_IN := proto
PROTO_OUT := pb
PROTO_DEPS := $(wildcard $(PROTO_IN)/*.proto)
.PHONY: all
all: protos
go build .
.PHONY: protos
protos: $(PROTO_DEPS)
protoc -I=./$(PROTO_IN) --go_out=paths=source_relative:$(PROTO_OUT) \
--go-grpc_out=paths=source_relative:$(PROTO_OUT) $(PROTO_DEPS)
.PHONY: clean
clean:
rm -f pb/*
rm -f api-client
.PHONY: docker
docker: all
docker build . -t rocketrescuenode/rescue-proxy:$(VERSION)
docker tag rocketrescuenode/rescue-proxy:$(VERSION) rocketrescuenode/rescue-proxy:latest
docker tag rocketrescuenode/rescue-proxy:$(VERSION) rescue-proxy:latest
.PHONY: publish
publish:
docker push rocketrescuenode/rescue-proxy:latest
docker push rocketrescuenode/rescue-proxy:$(VERSION)
.DELETE_ON_ERROR: cov.out
cov.out: $(SOURCES)
go test -coverprofile=cov.out ./...
.PHONY: testcov
testcov: cov.out
go tool cover -html=cov.out
./api-client: protos
go build -o api-client api/client/main.go