Lili Cosic b23ab1f759 tests/functional: Require same version of protoc everwhere
The main genproto.sh script requires latest version, this confirms the
test protoc to do the same.
2021-05-20 13:41:41 +02:00

29 lines
813 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
# protoc version should be the same as one in main etcd scripts.
if [[ $(protoc --version | cut -f2 -d' ') != "3.14.0" ]]; then
echo "could not find protoc 3.14.0, is it installed + in PATH?"
exit 255
fi
echo "Installing gogo/protobuf..."
GOGOPROTO_ROOT="$GOPATH/src/github.com/gogo/protobuf"
rm -rf $GOGOPROTO_ROOT
go get -v github.com/gogo/protobuf/{proto,protoc-gen-gogo,gogoproto,protoc-gen-gofast}
go get -v golang.org/x/tools/cmd/goimports
pushd "${GOGOPROTO_ROOT}"
git reset --hard HEAD
make install
popd
printf "Generating agent\n"
protoc --gofast_out=plugins=grpc:. \
--proto_path=$GOPATH/src:$GOPATH/src/github.com/gogo/protobuf/protobuf:. \
rpcpb/*.proto;