Skip to content

Commit a7f76da

Browse files
committed
Included generated files open-telemetry#1787
1 parent f8e6fc7 commit a7f76da

File tree

3 files changed

+4033
-4
lines changed

3 files changed

+4033
-4
lines changed

docker-gen-proto.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ gen_proto_python() {
3333
gen_proto_ts() {
3434
echo "Generating Typescript protobuf files for $1"
3535
docker build -f "src/$1/genproto/Dockerfile" -t "$1-genproto" .
36-
docker run --rm -v $(pwd):/build "$1-genproto"
36+
docker run --rm -e SERVICE=$1 -v $(pwd):/build "$1-genproto" /bin/sh -c '
37+
mkdir -p /build/src/$SERVICE/protos && \
38+
protoc -I /build/pb \
39+
--plugin=protoc-gen-ts_proto=/app/node_modules/.bin/protoc-gen-ts_proto \
40+
--ts_proto_opt=esModuleInterop=true \
41+
--ts_proto_out="/build/src/$SERVICE/protos" \
42+
--ts_proto_opt=outputServices=grpc-js \
43+
/build/pb/demo.proto'
3744
}
3845

3946
if [ -z "$1" ]; then

src/frontend/genproto/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
FROM node:20-alpine
55

6-
WORKDIR /build
6+
WORKDIR /app
77

88
RUN apk add --no-cache libc6-compat protobuf-dev protoc
99

1010
COPY ./src/frontend/package*.json ./
11-
COPY ./pb ./pb
11+
1212
RUN npm ci
1313

14-
CMD ["npm", "run", "grpc:generate"]
14+
COPY ./pb /build/pb

0 commit comments

Comments
 (0)