-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.yml
55 lines (47 loc) · 1.62 KB
/
taskfile.yml
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# https://taskfile.dev
version: "3"
tasks:
proto:all:
desc: Generate all protobuf files for all services
cmds:
- task proto:gen:job-distributor
- task proto:gen:orchestrator
- task go:mod:tidy
proto:gen:job-distributor:
desc: Generate all protobuf files for the job-distributor service
cmds:
- find ./job-distributor/ -name '*.pb.go' -delete
- task: proto:gen
vars:
SERVICE_NAME: job-distributor
proto:gen:orchestrator:
desc: "Generate Go code from protobuf files for orchestrator"
cmds:
- find ./orchestrator/ -name '*.pb.go' -delete
- task: proto:wsrpc:gen
vars:
SERVICE_NAME: orchestrator
proto:clean:
desc: "Clean generated protobuf files for all services"
cmds:
- find ./job-distributor/ -name '*.pb.go' -delete
- find ./orchestrator/ -name '*.pb.go' -delete
go:mod:tidy:
desc: "Run go mod tidy in each service folder"
cmds:
- (cd ./job-distributor && go mod tidy)
- (cd ./orchestrator && go mod tidy)
proto:gen:
internal: true
desc: "Generate Go code from protobuf files"
cmds:
- |
proto_files=$(find ./{{.SERVICE_NAME}} -name "*.proto")
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative $proto_files
proto:wsrpc:gen:
internal: true
desc: "Generate Go code from protobuf files with wsrpc"
cmds:
- |
proto_files=$(find ./{{.SERVICE_NAME}} -name "*.proto")
protoc --go_out=. --go_opt=paths=source_relative --go-wsrpc_out=. --go-wsrpc_opt=paths=source_relative $proto_files