Merge pull request #614 from owncloud/ocs-version-command

add version command and add build information to metrics
This commit is contained in:
Jörn Friedrich Dreyer
2020-09-28 21:14:08 +02:00
committed by GitHub
10 changed files with 119 additions and 14 deletions

View File

@@ -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