From 705cab052d2f6fad3dc47b6bb42e891e03df2ab1 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 27 Feb 2025 14:20:48 -0700 Subject: chore: add magefile to run multiple servers --- .tool-versions | 1 + go.mod | 5 +++++ go.sum | 2 ++ magefile.go | 30 ++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 magefile.go diff --git a/.tool-versions b/.tool-versions index ae5ecdb2..63e59501 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1,2 @@ +mage 1.15.0 ruby 3.4.2 diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..0d51d36c --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module gitlab.com/mokhax/spike + +go 1.24.0 + +require github.com/magefile/mage v1.15.0 diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..4ee1b877 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= +github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= diff --git a/magefile.go b/magefile.go new file mode 100644 index 00000000..b092d74c --- /dev/null +++ b/magefile.go @@ -0,0 +1,30 @@ +//go:build mage +// +build mage + +package main + +import ( + "context" + + "github.com/magefile/mage/mg" + "github.com/magefile/mage/sh" +) + +// Default target to run when none is specified +// If not set, running mage will list available targets +var Default = Run + +// Run the Identity Provider +func RunIdp() error { + return sh.RunV("ruby", "./bin/idp") +} + +// Run the Service Provider +func RunSp() error { + return sh.RunV("ruby", "./bin/sp") +} + +// Run All the servers +func Run(ctx context.Context) { + mg.CtxDeps(ctx, RunIdp, RunSp) +} -- cgit v1.2.3