Skip to content

Commit

Permalink
ci: fix build
Browse files Browse the repository at this point in the history
Fixes #71

Signed-off-by: Matt Klein <mklein@lyft.com>
  • Loading branch information
mattklein123 committed Apr 5, 2019
1 parent 459ed65 commit 186d1a9
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ GOREPO := ${GOPATH}/src/github.com/lyft/ratelimit
.PHONY: bootstrap
bootstrap:
script/install-glide
script/install-protoc
glide install
script/install-protoc

.PHONY: bootstrap_tests
bootstrap_tests:
Expand Down
6 changes: 3 additions & 3 deletions proto/envoy/api/v2/ratelimit/ratelimit.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions proto/envoy/service/ratelimit/v2/rls.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions proto/ratelimit/ratelimit.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions script/generate_proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env bash

protoc=$(which protoc)
export PATH=:`pwd`/bin:"$PATH"

protoc=bin/protoc/bin/protoc
$protoc --version

# Legacy ratelimit proto
protoc --go_out=plugins=grpc:. proto/ratelimit/*.proto
$protoc --go_out=plugins=grpc:. proto/ratelimit/*.proto

# Data-plane-api proto
data_plane_cmd="protoc --go_out=plugins=grpc,Menvoy/api/v2/ratelimit/ratelimit.proto=github.com/lyft/ratelimit/proto/envoy/api/v2/ratelimit:proto/. --proto_path=vendor/github.com/envoyproxy/data-plane-api --proto_path=vendor/github.com/lyft/protoc-gen-validate --proto_path=vendor/github.com/google/protobuf/src "
data_plane_cmd="$protoc --go_out=plugins=grpc,Menvoy/api/v2/ratelimit/ratelimit.proto=github.com/lyft/ratelimit/proto/envoy/api/v2/ratelimit:proto/. --proto_path=vendor/github.com/envoyproxy/data-plane-api --proto_path=vendor/github.com/lyft/protoc-gen-validate --proto_path=vendor/github.com/google/protobuf/src "
${data_plane_cmd} vendor/github.com/envoyproxy/data-plane-api/envoy/service/ratelimit/v2/rls.proto
${data_plane_cmd} vendor/github.com/envoyproxy/data-plane-api/envoy/api/v2/ratelimit/ratelimit.proto
11 changes: 4 additions & 7 deletions script/install-protoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ PROTOC_REL=protoc-"${PROTOC_VER}"-linux-x86_64.zip
pushd /tmp
wget https://github.com/google/protobuf/releases/download/v"${PROTOC_VER}/${PROTOC_REL}"
unzip "${PROTOC_REL}" -d protoc

if which sudo >/dev/null;
then sudo mv protoc /usr/local && sudo ln -s /usr/local/protoc/bin/protoc /usr/local/bin
else
mv protoc /usr/local && ln -s /usr/local/protoc/bin/protoc /usr/local/bin
fi
popd
go get -u github.com/golang/protobuf/protoc-gen-go

mkdir -p bin
mv /tmp/protoc bin/protoc
go build -o bin/protoc-gen-go ./vendor/github.com/golang/protobuf/protoc-gen-go

0 comments on commit 186d1a9

Please sign in to comment.