Merge branch 'master' into jsoncs3-share-manager
This commit is contained in:
+21
-16
@@ -2,7 +2,6 @@ package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
@@ -13,6 +12,7 @@ import (
|
||||
"github.com/cs3org/reva/v2/pkg/share/manager/registry"
|
||||
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
|
||||
oclog "github.com/owncloud/ocis/v2/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/v2/ocis/pkg/register"
|
||||
@@ -27,21 +27,6 @@ func Migrate(cfg *config.Config) *cli.Command {
|
||||
Name: "migrate",
|
||||
Usage: "migrate data from an existing to another instance",
|
||||
Category: "migration",
|
||||
Before: func(c *cli.Context) error {
|
||||
// Parse base config
|
||||
if err := parser.ParseConfig(cfg, true); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
// Parse sharing config
|
||||
cfg.Sharing.Commons = cfg.Commons
|
||||
if err := sharingparser.ParseConfig(cfg.Sharing); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
Subcommands: []*cli.Command{
|
||||
MigrateShares(cfg),
|
||||
MigratePublicShares(cfg),
|
||||
@@ -69,6 +54,16 @@ func MigrateShares(cfg *config.Config) *cli.Command {
|
||||
Usage: "Share manager to import the data into",
|
||||
},
|
||||
},
|
||||
Before: func(c *cli.Context) error {
|
||||
// Parse base config
|
||||
if err := parser.ParseConfig(cfg, true); err != nil {
|
||||
return configlog.ReturnError(err)
|
||||
}
|
||||
|
||||
// Parse sharing config
|
||||
cfg.Sharing.Commons = cfg.Commons
|
||||
return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing))
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
log := oclog.LoggerFromConfig("migrate", cfg.Log)
|
||||
ctx := log.WithContext(context.Background())
|
||||
@@ -154,6 +149,16 @@ func MigratePublicShares(cfg *config.Config) *cli.Command {
|
||||
Usage: "Public share manager to import the data into",
|
||||
},
|
||||
},
|
||||
Before: func(c *cli.Context) error {
|
||||
// Parse base config
|
||||
if err := parser.ParseConfig(cfg, true); err != nil {
|
||||
return configlog.ReturnError(err)
|
||||
}
|
||||
|
||||
// Parse sharing config
|
||||
cfg.Sharing.Commons = cfg.Commons
|
||||
return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing))
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
log := oclog.LoggerFromConfig("migrate", cfg.Log)
|
||||
ctx := log.WithContext(context.Background())
|
||||
|
||||
Reference in New Issue
Block a user