Skip to content

Commit

Permalink
optimize docker proto maker
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby committed Feb 19, 2024
1 parent 6152c87 commit 1de5f3f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ clean:

protobuf:
docker build -f generate-protobuf.Dockerfile . -t ydb-go-sdk-proto-generator-env
docker run -v ${PWD}:/github.com/ydb-platform/ydb-go-genproto/volumes -it ydb-go-sdk-proto-generator-env:latest bash /github.com/ydb-platform/ydb-go-genproto/volumes/generate_proto.sh
docker run -v ${PWD}:/project -it ydb-go-sdk-proto-generator-env:latest bash ./generate_proto.sh
6 changes: 1 addition & 5 deletions generate-protobuf.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ FROM golang:1.21
ARG PROTOC_VER=25.1
ARG PTOCOC_GEN_GO=1.31.0
ARG PROTOC_GEN_GO_GRPC=1.3.0
ENV GOBIN=/github.com/ydb-platform/ydb-go-genproto/
ENV PATH="${PATH}:/github.com/ydb-platform/ydb-go-genproto/"

COPY . /github.com/ydb-platform/ydb-go-genproto/
RUN mkdir /github.com/ydb-platform/ydb-go-genproto/volumes
WORKDIR /github.com/ydb-platform/ydb-go-genproto/
WORKDIR /project

RUN apt-get update && apt-get install -y unzip && apt-get clean

Expand Down
10 changes: 5 additions & 5 deletions generate_proto.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
protoc --go_out=volumes --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=volumes --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=/github.com/ydb-platform/ydb-go-genproto/api/ /github.com/ydb-platform/ydb-go-genproto/api/*.proto
protoc --go_out=volumes --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=volumes --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=/github.com/ydb-platform/ydb-go-genproto/api/ /github.com/ydb-platform/ydb-go-genproto/api/protos/*.proto
protoc --go_out=volumes --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=volumes --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=/github.com/ydb-platform/ydb-go-genproto/api/ /github.com/ydb-platform/ydb-go-genproto/api/protos/annotations/*.proto
protoc --go_out=volumes --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=volumes --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=/github.com/ydb-platform/ydb-go-genproto/api/ /github.com/ydb-platform/ydb-go-genproto/api/draft/protos/*.proto
protoc --go_out=volumes --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=volumes --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=/github.com/ydb-platform/ydb-go-genproto/api/ /github.com/ydb-platform/ydb-go-genproto/api/draft/*.proto
protoc --go_out=./ --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=./ --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=./api/ ./api/*.proto
protoc --go_out=./ --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=./ --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=./api/ ./api/protos/*.proto
protoc --go_out=./ --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=./ --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=./api/ ./api/protos/annotations/*.proto
protoc --go_out=./ --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=./ --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=./api/ ./api/draft/protos/*.proto
protoc --go_out=./ --go_opt=module=github.com/ydb-platform/ydb-go-genproto --go-grpc_out=./ --go-grpc_opt=module=github.com/ydb-platform/ydb-go-genproto --proto_path=./api/ ./api/draft/*.proto

0 comments on commit 1de5f3f

Please sign in to comment.