Add deps & protoc to makefile

Took 11 minutes
This commit is contained in:
Denis Arh
2018-07-11 20:32:19 +02:00
parent 661f5d4e94
commit ac8735945c
2 changed files with 14 additions and 9 deletions
+14
View File
@@ -1,6 +1,7 @@
.PHONY: build
SPEC=$(GOPATH)/bin/spec
PROTOC=$(GOPATH)/bin/protoc-gen-go
build:
docker build --rm -t $(shell cat .project) .
@@ -8,6 +9,19 @@ build:
$(SPEC):
go get github.com/titpetric/spec/cmd/spec
$(PROTOC):
go get -u github.com/golang/protobuf/protoc-gen-go
spec: $(SPEC)
cd sam/docs/src && $(SPEC)
cd sam/ && php _gen.php
protobuf: $(PROTOC)
# @todo this needs work (it hangs and outputs nothing)
$(PROTOC) --go_out=plugins=grpc:. -I. sam/chat/*.proto
dep:
dep ensure -v
dep.update:
dep ensure -update -v
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
set -e
PROJECT=$(<.project)
if [ -d "vendor" ]; then
docker run --rm -v $(pwd):/go/src/github.com/$PROJECT -w /go/src/github.com/$PROJECT -e GOOS=${OS} -e GOARCH=${ARCH} -e CGO_ENABLED=0 -e GOARM=7 titpetric/golang dep ensure -update -v
else
docker run --rm -v $(pwd):/go/src/github.com/$PROJECT -w /go/src/github.com/$PROJECT -e GOOS=${OS} -e GOARCH=${ARCH} -e CGO_ENABLED=0 -e GOARM=7 titpetric/golang dep init
fi