Cleanup & refactor protobuf codegen

This commit is contained in:
Denis Arh
2020-02-26 08:20:59 +01:00
parent c34814b855
commit d2fcb352ec
11 changed files with 14 additions and 1085 deletions
+13 -2
View File
@@ -170,7 +170,18 @@ function specs {
function proto {
yellow "> proto"
CORTEZA_PROTOBUF_PATH=${CORTEZA_PROTOBUF_PATH:-"vendor/github.com/cortezaproject/corteza-protobuf"}
# Where should we look for the files
PROTOBUF_PATH="codegen/corteza-protobuf"
CORTEZA_PROTOBUF_PATH=${CORTEZA_PROTOBUF_PATH:-"${PROTOBUF_PATH}"}
# Download protobufs to the primary location
BRANCH=${BRANCH:-"develop"}
ZIP="${BRANCH}.zip"
URL=${URL:-"https://github.com/cortezaproject/corteza-protobuf/archive/${ZIP}"}
rm -rf "${PROTOBUF_PATH}"
curl -s --location "${URL}" > "codegen/${ZIP}"
unzip -qq -o -d "codegen/" "codegen/${ZIP}"
mv -f "codegen/corteza-protobuf-${BRANCH}" "${PROTOBUF_PATH}"
DIR=./pkg/corredor
mkdir -p ${DIR}
@@ -184,7 +195,7 @@ function proto {
PATH=$PATH:$GOPATH/bin protoc \
--proto_path ${CORTEZA_PROTOBUF_PATH}/system \
--go_out=plugins=grpc:system/proto \
user.proto role.proto mail_message.proto
user.proto role.proto
green "OK"
}