blob: 40df5ade7c1b3afa395ebe9b3f3949bdb48cc166 (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
//go:build mage
// +build mage
package main
import (
"context"
"runtime"
"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 the API Gateway
func RunGateway() error {
return sh.RunV("go", "run", "./cmd/gtwy/main.go")
}
// Run the REST API
func RunApi() error {
return sh.RunV("ruby", "./bin/rest-api")
}
// Open a web browser to the login page
func Browser() error {
if runtime.GOOS == "linux" {
return sh.RunV("xdg-open", "http://localhost:8080/sp/sessions/new")
} else {
return sh.RunV("open", "http://localhost:8080/sp/sessions/new")
}
}
// Run All the servers
func Run(ctx context.Context) {
mg.CtxDeps(ctx, RunIdp, RunSp, RunApi, RunGateway)
}
|