forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-proto.sh
executable file
·30 lines (29 loc) · 1.45 KB
/
generate-proto.sh
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
#!/bin/bash
set -eux -o pipefail
go get k8s.io/code-generator/cmd/[email protected]
go get github.com/grpc-ecosystem/grpc-gateway/[email protected]
go get github.com/grpc-ecosystem/grpc-gateway/[email protected]
go get github.com/gogo/protobuf/[email protected]
go get github.com/gogo/protobuf/[email protected]
go get github.com/gogo/protobuf/[email protected]
go get golang.org/x/tools/cmd/goimports
go install k8s.io/code-generator/cmd/go-to-protobuf
go-to-protobuf \
--go-header-file=./hack/custom-boilerplate.go.txt \
--packages=github.com/argoproj/argo/pkg/apis/workflow/v1alpha1 \
--apimachinery-packages=+k8s.io/apimachinery/pkg/util/intstr,+k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime/schema,+k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1,k8s.io/api/policy/v1beta1 \
--proto-import ./vendor
for f in $(find pkg -name '*.proto'); do
protoc \
-I /usr/local/include \
-I . \
-I ./vendor \
-I ${GOPATH}/src \
-I ${GOPATH}/pkg/mod/github.com/gogo/[email protected]/gogoproto \
-I ${GOPATH}/pkg/mod/github.com/grpc-ecosystem/[email protected]/third_party/googleapis \
--include_imports \
--gogofast_out=plugins=grpc:${GOPATH}/src \
--grpc-gateway_out=logtostderr=true:${GOPATH}/src \
--swagger_out=logtostderr=true,fqn_for_swagger_name=true:. \
$f
done