/
Makefile
29 lines (23 loc) · 1.03 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
.PHONY: grpc deps build test binary
REPO_PATH := github.com/projecteru2/core
REVISION := $(shell git rev-parse HEAD || unknown)
BUILTAT := $(shell date +%Y-%m-%dT%H:%M:%S)
VERSION := $(shell cat VERSION)
GO_LDFLAGS ?= -s -X $(REPO_PATH)/versioninfo.REVISION=$(REVISION) \
-X $(REPO_PATH)/versioninfo.BUILTAT=$(BUILTAT) \
-X $(REPO_PATH)/versioninfo.VERSION=$(VERSION)
grpc:
cd ./rpc/gen/; protoc --go_out=plugins=grpc:. core.proto
cd ./rpc/gen/; python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. core.proto;
deps:
glide i
rm -rf ./vendor/github.com/docker/docker/vendor
rm -rf ./vendor/github.com/docker/distribution/vendor
binary:
go build -ldflags "$(GO_LDFLAGS)" -a -tags netgo -installsuffix netgo -o eru-core
build: deps binary
test: deps
# fix mock docker client bug, see https://github.com/moby/moby/pull/34383 [docker 17.05.0-ce]
sed -i.bak "143s/\*http.Transport/http.RoundTripper/" ./vendor/github.com/docker/docker/client/client.go
go vet `go list ./... | grep -v '/vendor/'`
go test -cover -v `glide nv`