2023-02-03 11:04:53 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-08-26 18:11:38 +00:00
|
|
|
#
|
2022-08-29 20:54:32 +00:00
|
|
|
# Generates protos for Teleport and Teleport API.
|
2022-08-26 18:11:38 +00:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")" # ./build-assets/
|
|
|
|
cd ../ # teleport root
|
|
|
|
|
|
|
|
# Generated protos are written to
|
|
|
|
# <teleport-root>/github.com/gravitational/teleport/..., so we copy them to
|
|
|
|
# the correct relative path.
|
2023-02-03 14:47:06 +00:00
|
|
|
trap 'rm -fr github.com' EXIT # don't leave github.com/ behind
|
|
|
|
rm -fr api/gen/proto gen/proto # cleanup gen/proto folders
|
2022-10-11 22:21:38 +00:00
|
|
|
|
2023-01-09 11:31:35 +00:00
|
|
|
# Generate Gogo protos.
|
|
|
|
buf generate --template=buf-gogo.gen.yaml api/proto
|
|
|
|
buf generate --template=buf-gogo.gen.yaml proto
|
2022-10-11 22:21:38 +00:00
|
|
|
|
|
|
|
# Generate protoc-gen-go protos (preferred).
|
|
|
|
# Add your protos to the list if you can.
|
|
|
|
buf generate --template=buf-go.gen.yaml \
|
|
|
|
--path=api/proto/teleport/devicetrust/ \
|
2022-11-29 22:55:03 +00:00
|
|
|
--path=api/proto/teleport/loginrule/ \
|
2023-01-06 21:38:38 +00:00
|
|
|
--path=api/proto/teleport/proxy/ \
|
2023-02-03 14:47:06 +00:00
|
|
|
--path=proto/teleport/lib/multiplexer/ \
|
|
|
|
--path=proto/teleport/lib/teleterm/
|
|
|
|
|
|
|
|
# Generate connect-go protos.
|
|
|
|
buf generate --template=buf-connect-go.gen.yaml \
|
|
|
|
--path=proto/prehog/
|
|
|
|
|
|
|
|
# Generate JS protos.
|
|
|
|
buf generate --template=buf-js.gen.yaml \
|
|
|
|
--path=proto/prehog/ \
|
|
|
|
--path=proto/teleport/lib/teleterm/
|
2023-01-26 08:41:07 +00:00
|
|
|
|
2022-08-29 20:54:32 +00:00
|
|
|
cp -r github.com/gravitational/teleport/* .
|
2022-08-26 18:11:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|