mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-13 09:49:17 -05:00
Merge pull request #614 from owncloud/ocs-version-command
add version command and add build information to metrics
This commit is contained in:
@@ -4,6 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/ocs/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/ocs/pkg/config"
|
||||
"github.com/owncloud/ocis/ocs/pkg/flagset"
|
||||
@@ -18,6 +19,9 @@ func OCSCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start ocs server",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.ServerWithConfig(cfg.OCS),
|
||||
Subcommands: []*cli.Command{
|
||||
command.PrintVersion(cfg.OCS),
|
||||
},
|
||||
Action: func(ctx *cli.Context) error {
|
||||
ocsCommand := command.Server(configureOCS(cfg))
|
||||
|
||||
@@ -34,6 +38,7 @@ func configureOCS(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.OCS.Log.Level = cfg.Log.Level
|
||||
cfg.OCS.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.OCS.Log.Color = cfg.Log.Color
|
||||
cfg.OCS.Service.Version = version.String
|
||||
|
||||
if cfg.Tracing.Enabled {
|
||||
cfg.OCS.Tracing.Enabled = cfg.Tracing.Enabled
|
||||
|
||||
Reference in New Issue
Block a user