2021-01-15 15:44:50 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Directory of the script file, independent of where it's called from.
|
|
|
|
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
|
|
|
|
|
|
|
PROTOC_GEN_VERSION=$(go list -f '{{.Version}}' -m github.com/golang/protobuf)
|
|
|
|
GRPC_GATEWAY_VERSION=$(go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway)
|
|
|
|
|
|
|
|
echo "Building protobuf compiler docker image..."
|
2021-02-01 21:02:36 +03:00
|
|
|
docker build -t lnd-protobuf-builder \
|
2021-01-15 15:44:50 +03:00
|
|
|
--build-arg PROTOC_GEN_VERSION="$PROTOC_GEN_VERSION" \
|
|
|
|
--build-arg GRPC_GATEWAY_VERSION="$GRPC_GATEWAY_VERSION" \
|
|
|
|
.
|
|
|
|
|
|
|
|
echo "Compiling and formatting *.proto files..."
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--user "$UID:$(id -g)" \
|
|
|
|
-e UID=$UID \
|
2021-01-15 15:44:54 +03:00
|
|
|
-e COMPILE_MOBILE \
|
2021-04-06 13:52:27 +03:00
|
|
|
-e SUBSERVER_PREFIX \
|
2021-01-15 15:44:50 +03:00
|
|
|
-v "$DIR/../:/build" \
|
|
|
|
lnd-protobuf-builder
|