Files
opencloud/ocis/pkg/command/server.go
Jörn Friedrich Dreyer 8e028f17e9 change module name
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 09:58:18 +01:00

32 lines
939 B
Go

package command
import (
"github.com/opencloud-eu/opencloud/ocis-pkg/config"
"github.com/opencloud-eu/opencloud/ocis-pkg/config/configlog"
"github.com/opencloud-eu/opencloud/ocis-pkg/config/parser"
"github.com/opencloud-eu/opencloud/ocis/pkg/register"
"github.com/opencloud-eu/opencloud/ocis/pkg/runtime"
"github.com/urfave/cli/v2"
)
// Server is the entrypoint for the server command.
func Server(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "server",
Usage: "start a fullstack server (runtime and all services in supervised mode)",
Category: "fullstack",
Before: func(c *cli.Context) error {
return configlog.ReturnError(parser.ParseConfig(cfg, false))
},
Action: func(c *cli.Context) error {
// Prefer the in-memory registry as the default when running in single-binary mode
r := runtime.New(cfg)
return r.Start(c.Context)
},
}
}
func init() {
register.AddCommand(Server)
}