-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish do codegen inside docker with fixed versions of protoc + protoc-gen-go
- Loading branch information
1 parent
1623f57
commit 72fd6cf
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
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 -Iapi -Iapi/protos -Iapi/protos/annotations -Iapi/draft -Iapi/draft/protos api/{*.proto,protos/*.proto,protos/annotations/*.proto,draft/*.proto,draft/protos/*.proto} | ||
proto: protobuf-3 | ||
|
||
protobuf-3: | ||
docker build -f generate-protobuf.Dockerfile . -t ydb-go-sdk-proto-generator-env-3 --build-arg PROTOC_VER=25.3 --build-arg PTOCOC_GEN_GO=1.32.0 --build-arg PROTOC_GEN_GO_GRPC=1.3.0 | ||
docker run -v ${PWD}:/github.com/ydb-platform/ydb-go-genproto/volumes -it ydb-go-sdk-proto-generator-env-3:latest bash generate_proto.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM golang:1.16-alpine | ||
|
||
ARG PROTOC_VER=25.3 | ||
ARG PTOCOC_GEN_GO=1.32.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/ | ||
|
||
RUN \ | ||
wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip &&\ | ||
unzip -o protoc-*.zip -d /usr/local bin/protoc &&\ | ||
unzip -o protoc-*.zip -d /usr/local 'include/*' &&\ | ||
rm -f protoc-*.zip | ||
|
||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PTOCOC_GEN_GO} | ||
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${PROTOC_GEN_GO_GRPC} | ||
RUN apk add bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 --experimental_allow_proto3_optional | ||
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 --experimental_allow_proto3_optional | ||
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 |