-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy.yml
More file actions
29 lines (26 loc) · 1019 Bytes
/
py.yml
File metadata and controls
29 lines (26 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
services:
protoc-py-better:
image: ghcr.io/akasandra/protoc-py-better:3.12
build:
context: .
dockerfile: py-better.Dockerfile
restart: no
entrypoint:
- /bin/sh
- -c
- |
# 1. Setup Output Directory
mkdir -p "/source/$${PROTOC_PATH_PY}"
echo "Cleaning old generated Python files..."
find "/source/$${PROTOC_PATH_PY}" -name '*.py' -delete
# 2. Absolute path to the verified binary
PLUGIN_BIN="/usr/local/bin/protoc-gen-python_betterproto2"
# 3. Compile
protoc \
--plugin=protoc-gen-python_betterproto="$$PLUGIN_BIN" \
--proto_path="/source/$${PROTO_SOURCES_DIR}" \
--python_betterproto_out="/source/$${PROTOC_PATH_PY}" \
--python_betterproto_opt=pydantic_dataclasses \
--python_betterproto_opt=client_generation=async \
--python_betterproto_opt=server_generation=async \
`find "/source/$${PROTO_SOURCES_DIR}" -maxdepth 1 -name "*.proto"`