forked from parca-dev/parca
-
Notifications
You must be signed in to change notification settings - Fork 2
/
env-proto.sh
executable file
·25 lines (21 loc) · 1.03 KB
/
env-proto.sh
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
#! /usr/bin/env bash
set -euo pipefail
BIN_DIR=${BIN_DIR:-/usr/local/bin}
INCLUDE_DIR=${INCLUDE_DIR:-/usr/local/include}
PROTOC_VERSION=${PROTOC_VERSION:-3.17.3}
mkdir -p ./tmp
PROTOC_VERSION="${PROTOC_VERSION}" BUILD_DIR="./tmp" scripts/download-protoc.sh
sudo mv -v -- "./tmp/protoc/bin/protoc" "${BIN_DIR}/protoc"
sudo cp -vR ./tmp/protoc/include/* "${INCLUDE_DIR}"
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.5.0
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.5.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
# Substitute VERSION for the current released version.
# Substitute BINARY_NAME for "buf", "protoc-gen-buf-breaking", or "protoc-gen-buf-lint".
VERSION="0.51.1" && \
BINARY_NAME="buf" && \
curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${VERSION}/${BINARY_NAME}-$(uname -s)-$(uname -m)" \
-o "${BIN_DIR}/${BINARY_NAME}" && \
chmod +x "${BIN_DIR}/${BINARY_NAME}"