-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo.yml
More file actions
29 lines (27 loc) · 1.01 KB
/
go.yml
File metadata and controls
29 lines (27 loc) · 1.01 KB
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-go:
image: ghcr.io/akasandra/protoc-go:1.25
build:
context: .
dockerfile: go.Dockerfile
network: host
restart: no
entrypoint:
- /bin/sh
- -c
- |
if [ ! -f /source/$${PROTO_SOURCES_DIR}/*.proto ]; then echo "Nothing .proto in source/$${PROTO_SOURCES_DIR}"; exit 2; fi
echo "List of Protobuf files to compile:"
find "/source/$${PROTO_SOURCES_DIR}" -type f
mkdir -p "/source/$${PROTOC_PATH_GO}"
echo "Delete old generated files"
find /source/$${PROTOC_PATH_GO} -name '*pb.go' -o -name '*grpc.go' | xargs rm -f
echo "Generate files at: source/$${PROTOC_PATH_GO}"
protoc \
--proto_path="/source/$${PROTO_SOURCES_DIR}" \
--go_out="/source/$${PROTOC_PATH_GO}" \
--go-grpc_out="/source/$${PROTOC_PATH_GO}" \
--go_opt=paths=source_relative \
--go-grpc_opt=paths=source_relative \
\
`echo $(find "/source/$${PROTO_SOURCES_DIR}" -type f)`