summaryrefslogtreecommitdiff
path: root/magefile.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-05 17:12:02 -0700
committermo khan <mo@mokhan.ca>2025-03-05 17:12:35 -0700
commit61b6d010fce0925e3d27ff33484153170e28147c (patch)
tree0ad4b678d0b0dc7d6b75fc29624d1f0c5b49672b /magefile.go
parent4100066e1d4dfc50f74e4d749ce29c8db2d3fa63 (diff)
feat: define the protobuf service definition
Diffstat (limited to 'magefile.go')
-rw-r--r--magefile.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/magefile.go b/magefile.go
index 8e1b969..5e17799 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)
}