-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Norihiro Hayashida
committed
Oct 22, 2021
1 parent
5c66bee
commit 9aad568
Showing
6 changed files
with
79 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM alpine:edge | ||
|
||
ARG PROTO_VERSION=3.18.1 | ||
ARG GRPCWEB_VERSION=1.3.0 | ||
|
||
LABEL version=${GRPCWEB_VERSION} | ||
LABEL maintainer="nrhrhysd616 <[email protected]>" | ||
LABEL description="protoc-gen-grpc-web" | ||
|
||
# install protobuf and curl | ||
RUN apk update && apk add --no-cache protobuf curl | ||
|
||
# download Google defined proto files | ||
RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTO_VERSION}/protoc-${PROTO_VERSION}-linux-x86_64.zip -o /tmp/protoc.zip && \ | ||
unzip -qq /tmp/protoc.zip -d /tmp && \ | ||
cp -r /tmp/include /usr/local && \ | ||
rm -rf /tmp/* | ||
|
||
# install protoc-gen-grpc-web | ||
RUN curl -sSL https://github.com/grpc/grpc-web/releases/download/${GRPCWEB_VERSION}/protoc-gen-grpc-web-${GRPCWEB_VERSION}-linux-x86_64 -o /usr/local/bin/protoc-gen-grpc-web && \ | ||
chmod +x /usr/local/bin/protoc-gen-grpc-web | ||
|
||
ADD scripts/entrypoint.sh / | ||
|
||
VOLUME [ "/protos", "/out" ] | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD [ "--grpc-web_out=import_style=commonjs,mode=grpcwebtext" ] |
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,8 @@ | ||
VERSION = 1.3.0 | ||
|
||
ifdef version | ||
VERSION=${version} | ||
endif | ||
|
||
build: | ||
docker build -t nrhrhysd616/protoc-gen-grpc-web:${VERSION} -t nrhrhysd616/protoc-gen-grpc-web:latest . |
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 @@ | ||
# nrhrhysd616/protoc-gen-grpc-web |
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,2 @@ | ||
* | ||
!.gitignore |
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,29 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
import "google/protobuf/empty.proto"; | ||
|
||
option java_multiple_files = true; | ||
option java_package = "com.example.user"; | ||
option java_outer_classname = "UserProto"; | ||
option objc_class_prefix = "HLW"; | ||
|
||
service UserService { | ||
rpc UpdateUser (UpdateUserRequest) returns (google.protobuf.Empty) {} | ||
rpc DeleteUser (DeleteUserRequest) returns (google.protobuf.Empty) {} | ||
} | ||
|
||
message UpdateUserRequest { | ||
string subject = 1; | ||
string username = 3; | ||
string email = 4; | ||
string displayName = 5; | ||
string phoneNumber = 6; | ||
string picture = 7; | ||
} | ||
|
||
message DeleteUserRequest { | ||
string subject = 1; | ||
} | ||
|
||
|
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,11 @@ | ||
#!/bin/sh | ||
|
||
PROTOS_DIR=/protos | ||
OUTPUT_DIR=/out | ||
|
||
args=$1 | ||
|
||
exec protoc \ | ||
--proto_path=/usr/local/include:${PROTOS_DIR} \ | ||
${args}:${OUTPUT_DIR} \ | ||
${PROTOS_DIR}/*.proto |