From 9f054c4ec5b5f393f13ad7154cf2fabd78773e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Sun, 11 Sep 2022 10:59:12 +0200 Subject: [PATCH] Add protoc_gen_shared.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: René Jochum --- docker/builder/scripts/protoc_gen_shared.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 docker/builder/scripts/protoc_gen_shared.sh diff --git a/docker/builder/scripts/protoc_gen_shared.sh b/docker/builder/scripts/protoc_gen_shared.sh new file mode 100755 index 0000000..c312c5f --- /dev/null +++ b/docker/builder/scripts/protoc_gen_shared.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -ex + +# Build shared +if test -d /code/shared/proto; then + for proto in $(find /code/shared/proto -type f -name '*.proto' -print0 | xargs -0); do + cd $(dirname ${proto}) + protoc -I/code --proto_path=$GOPATH/bin:. --micro_out=paths=source_relative:. --go_out=paths=source_relative:. $(basename ${proto}) + done +fi + +for proto in $(find /code/service -type f -name '*.proto' -print0 | xargs -0); do + cd $(dirname ${proto}) + protoc -I/code --proto_path=$GOPATH/bin:. --micro_out=paths=source_relative:. --go_out=paths=source_relative:. $(basename ${proto}) +done + +cd /code