diff options
Diffstat (limited to 'magefile.go')
| -rw-r--r-- | magefile.go | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/magefile.go b/magefile.go index 8e1b969b..5e177995 100644 --- a/magefile.go +++ b/magefile.go @@ -54,6 +54,16 @@ func Api() error { return sh.RunWithV(env, "ruby", "./bin/api") } +// Run the gRPC Server +func Rpc(ctx context.Context) error { + mg.CtxDeps(ctx, Protos) + env := map[string]string{ + "PORT": "50051", + "HOST": "localhost", + } + return sh.RunWithV(env, "ruby", "./bin/rpc") +} + // Open a web browser to the login page func Browser() error { url := "http://localhost:8080/ui/sessions/new" @@ -64,7 +74,18 @@ func Browser() error { } } +// Generate gRPC from protocal buffers +func Protos() error { + return sh.RunV( + "grpc_tools_ruby_protoc", + "--proto_path=./protos", + "--ruby_out=lib", + "--grpc_out=lib", + "protos/ability.proto", + ) +} + // Run All the servers func Run(ctx context.Context) { - mg.CtxDeps(ctx, Idp, UI, Api, Gateway) + mg.CtxDeps(ctx, Idp, UI, Api, Rpc, Gateway) } |
