From 7318ae7451e5d045c7e31dc4713d9921afaa4afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Tue, 4 Oct 2022 17:08:48 +0200 Subject: [PATCH] Add googleapis protos --- docker/builder/docker-entrypoint.sh | 8 ++++++++ docker/builder/scripts/protoc_gen.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docker/builder/docker-entrypoint.sh b/docker/builder/docker-entrypoint.sh index 9a307c6..a33f951 100755 --- a/docker/builder/docker-entrypoint.sh +++ b/docker/builder/docker-entrypoint.sh @@ -20,4 +20,12 @@ if [[ ! -x /go/bin/trunk ]]; then popd fi +# Protos +if [[ ! -d /go/protos/googleapis ]]; then + mkdir -p /go/protos + pushd /go/protos + git clone https://github.com/googleapis/googleapis.git + popd +fi + exec "$@" \ No newline at end of file diff --git a/docker/builder/scripts/protoc_gen.sh b/docker/builder/scripts/protoc_gen.sh index 01138ed..8a1733f 100755 --- a/docker/builder/scripts/protoc_gen.sh +++ b/docker/builder/scripts/protoc_gen.sh @@ -1,2 +1,2 @@ #!/bin/sh -find . -name '*.proto' -print0 | xargs -0 -I {} /bin/sh -c 'cd $(dirname $1); protoc --proto_path=$GOPATH/bin:. -I/code --micro_out=paths=source_relative:. --go_out=paths=source_relative:. $(basename $1)' '_' '{}' \ No newline at end of file +find . -name '*.proto' -print0 | xargs -0 -I {} /bin/sh -c 'cd $(dirname $1); protoc --proto_path=$GOPATH/bin:. -I /go/protos/googleapis -I/code --micro_out=paths=source_relative:. --go_out=paths=source_relative:. $(basename $1)' '_' '{}' \ No newline at end of file