-
Notifications
You must be signed in to change notification settings - Fork 28
/
cmd.go
34 lines (30 loc) · 804 Bytes
/
cmd.go
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
package e2e
import (
"fmt"
"os"
"os/exec"
)
func CreatePortalConfigSource(dbURL string, dbSchema string, resourceDir string) error {
cmd := fmt.Sprintf(
"../dist/authgear-portal internal configsource create %s --database-url=\"%s\" --database-schema=\"%s\"",
resourceDir,
dbURL,
dbSchema,
)
return ExecCmd(cmd)
}
func CreatePortalDefaultDomain(dbURL string, dbSchema string, defaultDomainSuffix string) error {
cmd := fmt.Sprintf(
"../dist/authgear-portal internal domain create-default --database-url=\"%s\" --database-schema=\"%s\" --default-domain-suffix=\"%s\"",
dbURL,
dbSchema,
defaultDomainSuffix,
)
return ExecCmd(cmd)
}
func ExecCmd(cmd string) error {
execCmd := exec.Command("sh", "-c", cmd)
execCmd.Dir = "."
execCmd.Stdout = os.Stdout
return execCmd.Run()
}