refactor: urfave v2
This commit is contained in:
parent
b8e1a3b75f
commit
16aeb441e7
@ -1,7 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var AppCommand = cli.Command{
|
var AppCommand = cli.Command{
|
||||||
@ -9,26 +9,26 @@ var AppCommand = cli.Command{
|
|||||||
Aliases: []string{"a"},
|
Aliases: []string{"a"},
|
||||||
Usage: "Manage apps",
|
Usage: "Manage apps",
|
||||||
ArgsUsage: "<domain>",
|
ArgsUsage: "<domain>",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
appBackupCommand,
|
&appBackupCommand,
|
||||||
appCheckCommand,
|
&appCheckCommand,
|
||||||
appCmdCommand,
|
&appCmdCommand,
|
||||||
appConfigCommand,
|
&appConfigCommand,
|
||||||
appCpCommand,
|
&appCpCommand,
|
||||||
appDeployCommand,
|
&appDeployCommand,
|
||||||
appListCommand,
|
&appListCommand,
|
||||||
appLogsCommand,
|
&appLogsCommand,
|
||||||
appNewCommand,
|
&appNewCommand,
|
||||||
appPsCommand,
|
&appPsCommand,
|
||||||
appRemoveCommand,
|
&appRemoveCommand,
|
||||||
appRestartCommand,
|
&appRestartCommand,
|
||||||
appRestoreCommand,
|
&appRestoreCommand,
|
||||||
appRollbackCommand,
|
&appRollbackCommand,
|
||||||
appRunCommand,
|
&appRunCommand,
|
||||||
appSecretCommand,
|
&appSecretCommand,
|
||||||
appServicesCommand,
|
&appServicesCommand,
|
||||||
appUndeployCommand,
|
&appUndeployCommand,
|
||||||
appUpgradeCommand,
|
&appUpgradeCommand,
|
||||||
appVolumeCommand,
|
&appVolumeCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -7,26 +7,29 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var snapshot string
|
var snapshot string
|
||||||
var snapshotFlag = &cli.StringFlag{
|
var snapshotFlag = &cli.StringFlag{
|
||||||
Name: "snapshot, s",
|
Name: "snapshot",
|
||||||
|
Aliases: []string{"s"},
|
||||||
Usage: "Lists specific snapshot",
|
Usage: "Lists specific snapshot",
|
||||||
Destination: &snapshot,
|
Destination: &snapshot,
|
||||||
}
|
}
|
||||||
|
|
||||||
var includePath string
|
var includePath string
|
||||||
var includePathFlag = &cli.StringFlag{
|
var includePathFlag = &cli.StringFlag{
|
||||||
Name: "path, p",
|
Name: "path",
|
||||||
|
Aliases: []string{"p"},
|
||||||
Usage: "Include path",
|
Usage: "Include path",
|
||||||
Destination: &includePath,
|
Destination: &includePath,
|
||||||
}
|
}
|
||||||
|
|
||||||
var resticRepo string
|
var resticRepo string
|
||||||
var resticRepoFlag = &cli.StringFlag{
|
var resticRepoFlag = &cli.StringFlag{
|
||||||
Name: "repo, r",
|
Name: "repo",
|
||||||
|
Aliases: []string{"r"},
|
||||||
Usage: "Restic repository",
|
Usage: "Restic repository",
|
||||||
Destination: &resticRepo,
|
Destination: &resticRepo,
|
||||||
}
|
}
|
||||||
@ -270,10 +273,10 @@ var appBackupCommand = cli.Command{
|
|||||||
Aliases: []string{"b"},
|
Aliases: []string{"b"},
|
||||||
Usage: "Manage app backups",
|
Usage: "Manage app backups",
|
||||||
ArgsUsage: "<domain>",
|
ArgsUsage: "<domain>",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
appBackupListCommand,
|
&appBackupListCommand,
|
||||||
appBackupSnapshotsCommand,
|
&appBackupSnapshotsCommand,
|
||||||
appBackupDownloadCommand,
|
&appBackupDownloadCommand,
|
||||||
appBackupCreateCommand,
|
&appBackupCreateCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appCheckCommand = cli.Command{
|
var appCheckCommand = cli.Command{
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appCmdCommand = cli.Command{
|
var appCmdCommand = cli.Command{
|
||||||
@ -42,11 +42,13 @@ EXAMPLE:
|
|||||||
internal.OfflineFlag,
|
internal.OfflineFlag,
|
||||||
internal.ChaosFlag,
|
internal.ChaosFlag,
|
||||||
},
|
},
|
||||||
Before: internal.SubCommandBefore,
|
Before: internal.SubCommandBefore,
|
||||||
Subcommands: []cli.Command{appCmdListCommand},
|
Subcommands: []*cli.Command{
|
||||||
|
&appCmdListCommand,
|
||||||
|
},
|
||||||
BashComplete: func(ctx *cli.Context) {
|
BashComplete: func(ctx *cli.Context) {
|
||||||
args := ctx.Args()
|
args := ctx.Args()
|
||||||
switch len(args) {
|
switch args.Len() {
|
||||||
case 0:
|
case 0:
|
||||||
autocomplete.AppNameComplete(ctx)
|
autocomplete.AppNameComplete(ctx)
|
||||||
case 1:
|
case 1:
|
||||||
@ -66,7 +68,7 @@ EXAMPLE:
|
|||||||
internal.ShowSubcommandHelpAndError(c, errors.New("cannot use --local & --user together"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("cannot use --local & --user together"))
|
||||||
}
|
}
|
||||||
|
|
||||||
hasCmdArgs, parsedCmdArgs := parseCmdArgs(c.Args(), internal.LocalCmd)
|
hasCmdArgs, parsedCmdArgs := parseCmdArgs(c.Args().Slice(), internal.LocalCmd)
|
||||||
|
|
||||||
if _, err := os.Stat(app.Recipe.AbraShPath); err != nil {
|
if _, err := os.Stat(app.Recipe.AbraShPath); err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
@ -76,7 +78,7 @@ EXAMPLE:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if internal.LocalCmd {
|
if internal.LocalCmd {
|
||||||
if !(len(c.Args()) >= 2) {
|
if !(c.Args().Len() >= 2) {
|
||||||
internal.ShowSubcommandHelpAndError(c, errors.New("missing arguments"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("missing arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +114,7 @@ EXAMPLE:
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !(len(c.Args()) >= 3) {
|
if !(c.Args().Len() >= 3) {
|
||||||
internal.ShowSubcommandHelpAndError(c, errors.New("missing arguments"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("missing arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appConfigCommand = cli.Command{
|
var appConfigCommand = cli.Command{
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
dockerClient "github.com/docker/docker/client"
|
dockerClient "github.com/docker/docker/client"
|
||||||
"github.com/docker/docker/errdefs"
|
"github.com/docker/docker/errdefs"
|
||||||
"github.com/docker/docker/pkg/archive"
|
"github.com/docker/docker/pkg/archive"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appCpCommand = cli.Command{
|
var appCpCommand = cli.Command{
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/lint"
|
"coopcloud.tech/abra/pkg/lint"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/upstream/stack"
|
"coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appDeployCommand = cli.Command{
|
var appDeployCommand = cli.Command{
|
||||||
|
@ -12,13 +12,14 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/tagcmp"
|
"coopcloud.tech/tagcmp"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
status bool
|
status bool
|
||||||
statusFlag = &cli.BoolFlag{
|
statusFlag = &cli.BoolFlag{
|
||||||
Name: "status, S",
|
Name: "status",
|
||||||
|
Aliases: []string{"S"},
|
||||||
Usage: "Show app deployment status",
|
Usage: "Show app deployment status",
|
||||||
Destination: &status,
|
Destination: &status,
|
||||||
}
|
}
|
||||||
@ -27,7 +28,8 @@ var (
|
|||||||
var (
|
var (
|
||||||
recipeFilter string
|
recipeFilter string
|
||||||
recipeFlag = &cli.StringFlag{
|
recipeFlag = &cli.StringFlag{
|
||||||
Name: "recipe, r",
|
Name: "recipe",
|
||||||
|
Aliases: []string{"r"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Show apps of a specific recipe",
|
Usage: "Show apps of a specific recipe",
|
||||||
Destination: &recipeFilter,
|
Destination: &recipeFilter,
|
||||||
@ -37,7 +39,8 @@ var (
|
|||||||
var (
|
var (
|
||||||
listAppServer string
|
listAppServer string
|
||||||
listAppServerFlag = &cli.StringFlag{
|
listAppServerFlag = &cli.StringFlag{
|
||||||
Name: "server, s",
|
Name: "server",
|
||||||
|
Aliases: []string{"s"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Show apps of a specific server",
|
Usage: "Show apps of a specific server",
|
||||||
Destination: &listAppServer,
|
Destination: &listAppServer,
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
dockerClient "github.com/docker/docker/client"
|
dockerClient "github.com/docker/docker/client"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appLogsCommand = cli.Command{
|
var appLogsCommand = cli.Command{
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/secret"
|
"coopcloud.tech/abra/pkg/secret"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
dockerClient "github.com/docker/docker/client"
|
dockerClient "github.com/docker/docker/client"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appNewDescription = `
|
var appNewDescription = `
|
||||||
@ -56,7 +56,7 @@ var appNewCommand = cli.Command{
|
|||||||
ArgsUsage: "[<recipe>] [<version>]",
|
ArgsUsage: "[<recipe>] [<version>]",
|
||||||
BashComplete: func(ctx *cli.Context) {
|
BashComplete: func(ctx *cli.Context) {
|
||||||
args := ctx.Args()
|
args := ctx.Args()
|
||||||
switch len(args) {
|
switch args.Len() {
|
||||||
case 0:
|
case 0:
|
||||||
autocomplete.RecipeNameComplete(ctx)
|
autocomplete.RecipeNameComplete(ctx)
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
containerTypes "github.com/docker/docker/api/types/container"
|
containerTypes "github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
dockerClient "github.com/docker/docker/client"
|
dockerClient "github.com/docker/docker/client"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appPsCommand = cli.Command{
|
var appPsCommand = cli.Command{
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appRemoveCommand = cli.Command{
|
var appRemoveCommand = cli.Command{
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
upstream "coopcloud.tech/abra/pkg/upstream/service"
|
upstream "coopcloud.tech/abra/pkg/upstream/service"
|
||||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appRestartCommand = cli.Command{
|
var appRestartCommand = cli.Command{
|
||||||
|
@ -7,12 +7,13 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var targetPath string
|
var targetPath string
|
||||||
var targetPathFlag = &cli.StringFlag{
|
var targetPathFlag = &cli.StringFlag{
|
||||||
Name: "target, t",
|
Name: "target",
|
||||||
|
Aliases: []string{"t"},
|
||||||
Usage: "Target path",
|
Usage: "Target path",
|
||||||
Destination: &targetPath,
|
Destination: &targetPath,
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appRollbackCommand = cli.Command{
|
var appRollbackCommand = cli.Command{
|
||||||
|
@ -14,19 +14,21 @@ import (
|
|||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var user string
|
var user string
|
||||||
var userFlag = &cli.StringFlag{
|
var userFlag = &cli.StringFlag{
|
||||||
Name: "user, u",
|
Name: "user",
|
||||||
|
Aliases: []string{"u"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Destination: &user,
|
Destination: &user,
|
||||||
}
|
}
|
||||||
|
|
||||||
var noTTY bool
|
var noTTY bool
|
||||||
var noTTYFlag = &cli.BoolFlag{
|
var noTTYFlag = &cli.BoolFlag{
|
||||||
Name: "no-tty, t",
|
Name: "no-tty",
|
||||||
|
Aliases: []string{"t"},
|
||||||
Destination: &noTTY,
|
Destination: &noTTY,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,11 +47,11 @@ var appRunCommand = cli.Command{
|
|||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
app := internal.ValidateApp(c)
|
app := internal.ValidateApp(c)
|
||||||
|
|
||||||
if len(c.Args()) < 2 {
|
if c.Args().Len() < 2 {
|
||||||
internal.ShowSubcommandHelpAndError(c, errors.New("no <service> provided?"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("no <service> provided?"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.Args()) < 3 {
|
if c.Args().Len() < 3 {
|
||||||
internal.ShowSubcommandHelpAndError(c, errors.New("no <args> provided?"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("no <args> provided?"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ var appRunCommand = cli.Command{
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := c.Args()[2:]
|
cmd := c.Args().Slice()[2:]
|
||||||
execCreateOpts := types.ExecConfig{
|
execCreateOpts := types.ExecConfig{
|
||||||
AttachStderr: true,
|
AttachStderr: true,
|
||||||
AttachStdin: true,
|
AttachStdin: true,
|
||||||
|
@ -17,13 +17,14 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/secret"
|
"coopcloud.tech/abra/pkg/secret"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
dockerClient "github.com/docker/docker/client"
|
dockerClient "github.com/docker/docker/client"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
allSecrets bool
|
allSecrets bool
|
||||||
allSecretsFlag = &cli.BoolFlag{
|
allSecretsFlag = &cli.BoolFlag{
|
||||||
Name: "all, a",
|
Name: "all",
|
||||||
|
Aliases: []string{"a"},
|
||||||
Destination: &allSecrets,
|
Destination: &allSecrets,
|
||||||
Usage: "Generate all secrets",
|
Usage: "Generate all secrets",
|
||||||
}
|
}
|
||||||
@ -32,7 +33,8 @@ var (
|
|||||||
var (
|
var (
|
||||||
rmAllSecrets bool
|
rmAllSecrets bool
|
||||||
rmAllSecretsFlag = &cli.BoolFlag{
|
rmAllSecretsFlag = &cli.BoolFlag{
|
||||||
Name: "all, a",
|
Name: "all",
|
||||||
|
Aliases: []string{"a"},
|
||||||
Destination: &rmAllSecrets,
|
Destination: &rmAllSecrets,
|
||||||
Usage: "Remove all secrets",
|
Usage: "Remove all secrets",
|
||||||
}
|
}
|
||||||
@ -59,7 +61,7 @@ var appSecretGenerateCommand = cli.Command{
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.Args()) == 1 && !allSecrets {
|
if c.Args().Len() == 1 && !allSecrets {
|
||||||
err := errors.New("missing arguments <secret>/<version> or '--all'")
|
err := errors.New("missing arguments <secret>/<version> or '--all'")
|
||||||
internal.ShowSubcommandHelpAndError(c, err)
|
internal.ShowSubcommandHelpAndError(c, err)
|
||||||
}
|
}
|
||||||
@ -160,7 +162,7 @@ Example:
|
|||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
app := internal.ValidateApp(c)
|
app := internal.ValidateApp(c)
|
||||||
|
|
||||||
if len(c.Args()) != 4 {
|
if c.Args().Len() != 4 {
|
||||||
internal.ShowSubcommandHelpAndError(c, errors.New("missing arguments?"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("missing arguments?"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,10 +384,10 @@ var appSecretCommand = cli.Command{
|
|||||||
Aliases: []string{"s"},
|
Aliases: []string{"s"},
|
||||||
Usage: "Manage app secrets",
|
Usage: "Manage app secrets",
|
||||||
ArgsUsage: "<domain>",
|
ArgsUsage: "<domain>",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
appSecretGenerateCommand,
|
&appSecretGenerateCommand,
|
||||||
appSecretInsertCommand,
|
&appSecretInsertCommand,
|
||||||
appSecretRmCommand,
|
&appSecretRmCommand,
|
||||||
appSecretLsCommand,
|
&appSecretLsCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/service"
|
"coopcloud.tech/abra/pkg/service"
|
||||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
containerTypes "github.com/docker/docker/api/types/container"
|
containerTypes "github.com/docker/docker/api/types/container"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appServicesCommand = cli.Command{
|
var appServicesCommand = cli.Command{
|
||||||
|
@ -13,13 +13,14 @@ import (
|
|||||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
dockerClient "github.com/docker/docker/client"
|
dockerClient "github.com/docker/docker/client"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var prune bool
|
var prune bool
|
||||||
|
|
||||||
var pruneFlag = &cli.BoolFlag{
|
var pruneFlag = &cli.BoolFlag{
|
||||||
Name: "prune, p",
|
Name: "prune",
|
||||||
|
Aliases: []string{"p"},
|
||||||
Destination: &prune,
|
Destination: &prune,
|
||||||
Usage: "Prunes unused containers, networks, and dangling images for an app",
|
Usage: "Prunes unused containers, networks, and dangling images for an app",
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"coopcloud.tech/tagcmp"
|
"coopcloud.tech/tagcmp"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appUpgradeCommand = cli.Command{
|
var appUpgradeCommand = cli.Command{
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/upstream/stack"
|
"coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var appVolumeListCommand = cli.Command{
|
var appVolumeListCommand = cli.Command{
|
||||||
@ -149,8 +149,8 @@ var appVolumeCommand = cli.Command{
|
|||||||
Aliases: []string{"vl"},
|
Aliases: []string{"vl"},
|
||||||
Usage: "Manage app volumes",
|
Usage: "Manage app volumes",
|
||||||
ArgsUsage: "<domain>",
|
ArgsUsage: "<domain>",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
appVolumeListCommand,
|
&appVolumeListCommand,
|
||||||
appVolumeRemoveCommand,
|
&appVolumeRemoveCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var catalogueGenerateCommand = cli.Command{
|
var catalogueGenerateCommand = cli.Command{
|
||||||
@ -209,7 +209,7 @@ var CatalogueCommand = cli.Command{
|
|||||||
Usage: "Manage the recipe catalogue",
|
Usage: "Manage the recipe catalogue",
|
||||||
Aliases: []string{"c"},
|
Aliases: []string{"c"},
|
||||||
ArgsUsage: "<recipe>",
|
ArgsUsage: "<recipe>",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
catalogueGenerateCommand,
|
&catalogueGenerateCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
16
cli/cli.go
16
cli/cli.go
@ -18,7 +18,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/web"
|
"coopcloud.tech/abra/pkg/web"
|
||||||
charmLog "github.com/charmbracelet/log"
|
charmLog "github.com/charmbracelet/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AutoCompleteCommand helps people set up auto-complete in their shells
|
// AutoCompleteCommand helps people set up auto-complete in their shells
|
||||||
@ -156,13 +156,13 @@ func newAbraApp(version, commit string) *cli.App {
|
|||||||
|_|
|
|_|
|
||||||
`,
|
`,
|
||||||
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
|
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
|
||||||
Commands: []cli.Command{
|
Commands: []*cli.Command{
|
||||||
app.AppCommand,
|
&app.AppCommand,
|
||||||
server.ServerCommand,
|
&server.ServerCommand,
|
||||||
recipe.RecipeCommand,
|
&recipe.RecipeCommand,
|
||||||
catalogue.CatalogueCommand,
|
&catalogue.CatalogueCommand,
|
||||||
UpgradeCommand,
|
&UpgradeCommand,
|
||||||
AutoCompleteCommand,
|
&AutoCompleteCommand,
|
||||||
},
|
},
|
||||||
BashComplete: autocomplete.SubcommandComplete,
|
BashComplete: autocomplete.SubcommandComplete,
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Secrets stores the variable from SecretsFlag
|
// Secrets stores the variable from SecretsFlag
|
||||||
@ -12,7 +12,8 @@ var Secrets bool
|
|||||||
|
|
||||||
// SecretsFlag turns on/off automatically generating secrets
|
// SecretsFlag turns on/off automatically generating secrets
|
||||||
var SecretsFlag = &cli.BoolFlag{
|
var SecretsFlag = &cli.BoolFlag{
|
||||||
Name: "secrets, S",
|
Name: "secrets",
|
||||||
|
Aliases: []string{"S"},
|
||||||
Usage: "Automatically generate secrets",
|
Usage: "Automatically generate secrets",
|
||||||
Destination: &Secrets,
|
Destination: &Secrets,
|
||||||
}
|
}
|
||||||
@ -22,7 +23,8 @@ var Pass bool
|
|||||||
|
|
||||||
// PassFlag turns on/off storing generated secrets in pass
|
// PassFlag turns on/off storing generated secrets in pass
|
||||||
var PassFlag = &cli.BoolFlag{
|
var PassFlag = &cli.BoolFlag{
|
||||||
Name: "pass, p",
|
Name: "pass",
|
||||||
|
Aliases: []string{"p"},
|
||||||
Usage: "Store the generated secrets in a local pass store",
|
Usage: "Store the generated secrets in a local pass store",
|
||||||
Destination: &Pass,
|
Destination: &Pass,
|
||||||
}
|
}
|
||||||
@ -32,21 +34,24 @@ var PassRemove bool
|
|||||||
|
|
||||||
// PassRemoveFlag turns on/off removing generated secrets from pass
|
// PassRemoveFlag turns on/off removing generated secrets from pass
|
||||||
var PassRemoveFlag = &cli.BoolFlag{
|
var PassRemoveFlag = &cli.BoolFlag{
|
||||||
Name: "pass, p",
|
Name: "pass",
|
||||||
|
Aliases: []string{"p"},
|
||||||
Usage: "Remove generated secrets from a local pass store",
|
Usage: "Remove generated secrets from a local pass store",
|
||||||
Destination: &PassRemove,
|
Destination: &PassRemove,
|
||||||
}
|
}
|
||||||
|
|
||||||
var File bool
|
var File bool
|
||||||
var FileFlag = &cli.BoolFlag{
|
var FileFlag = &cli.BoolFlag{
|
||||||
Name: "file, f",
|
Name: "file",
|
||||||
|
Aliases: []string{"f"},
|
||||||
Usage: "Treat input as a file",
|
Usage: "Treat input as a file",
|
||||||
Destination: &File,
|
Destination: &File,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Trim bool
|
var Trim bool
|
||||||
var TrimFlag = &cli.BoolFlag{
|
var TrimFlag = &cli.BoolFlag{
|
||||||
Name: "trim, t",
|
Name: "trim",
|
||||||
|
Aliases: []string{"t"},
|
||||||
Usage: "Trim input",
|
Usage: "Trim input",
|
||||||
Destination: &Trim,
|
Destination: &Trim,
|
||||||
}
|
}
|
||||||
@ -56,7 +61,8 @@ var Force bool
|
|||||||
|
|
||||||
// ForceFlag turns on/off force functionality.
|
// ForceFlag turns on/off force functionality.
|
||||||
var ForceFlag = &cli.BoolFlag{
|
var ForceFlag = &cli.BoolFlag{
|
||||||
Name: "force, f",
|
Name: "force",
|
||||||
|
Aliases: []string{"f"},
|
||||||
Usage: "Perform action without further prompt. Use with care!",
|
Usage: "Perform action without further prompt. Use with care!",
|
||||||
Destination: &Force,
|
Destination: &Force,
|
||||||
}
|
}
|
||||||
@ -66,7 +72,8 @@ var Chaos bool
|
|||||||
|
|
||||||
// ChaosFlag turns on/off chaos functionality.
|
// ChaosFlag turns on/off chaos functionality.
|
||||||
var ChaosFlag = &cli.BoolFlag{
|
var ChaosFlag = &cli.BoolFlag{
|
||||||
Name: "chaos, C",
|
Name: "chaos",
|
||||||
|
Aliases: []string{"C"},
|
||||||
Usage: "Proceed with uncommitted recipes changes. Use with care!",
|
Usage: "Proceed with uncommitted recipes changes. Use with care!",
|
||||||
Destination: &Chaos,
|
Destination: &Chaos,
|
||||||
}
|
}
|
||||||
@ -76,14 +83,16 @@ var Tty bool
|
|||||||
|
|
||||||
// TtyFlag turns on/off tty mode.
|
// TtyFlag turns on/off tty mode.
|
||||||
var TtyFlag = &cli.BoolFlag{
|
var TtyFlag = &cli.BoolFlag{
|
||||||
Name: "tty, T",
|
Name: "tty",
|
||||||
|
Aliases: []string{"T"},
|
||||||
Usage: "Disables TTY mode to run this command from a script.",
|
Usage: "Disables TTY mode to run this command from a script.",
|
||||||
Destination: &Tty,
|
Destination: &Tty,
|
||||||
}
|
}
|
||||||
|
|
||||||
var NoInput bool
|
var NoInput bool
|
||||||
var NoInputFlag = &cli.BoolFlag{
|
var NoInputFlag = &cli.BoolFlag{
|
||||||
Name: "no-input, n",
|
Name: "no-input",
|
||||||
|
Aliases: []string{"n"},
|
||||||
Usage: "Toggle non-interactive mode",
|
Usage: "Toggle non-interactive mode",
|
||||||
Destination: &NoInput,
|
Destination: &NoInput,
|
||||||
}
|
}
|
||||||
@ -93,7 +102,8 @@ var Debug bool
|
|||||||
|
|
||||||
// DebugFlag turns on/off verbose logging down to the DEBUG level.
|
// DebugFlag turns on/off verbose logging down to the DEBUG level.
|
||||||
var DebugFlag = &cli.BoolFlag{
|
var DebugFlag = &cli.BoolFlag{
|
||||||
Name: "debug, d",
|
Name: "debug",
|
||||||
|
Aliases: []string{"d"},
|
||||||
Destination: &Debug,
|
Destination: &Debug,
|
||||||
Usage: "Show DEBUG messages",
|
Usage: "Show DEBUG messages",
|
||||||
}
|
}
|
||||||
@ -103,7 +113,8 @@ var Offline bool
|
|||||||
|
|
||||||
// DebugFlag turns on/off offline mode.
|
// DebugFlag turns on/off offline mode.
|
||||||
var OfflineFlag = &cli.BoolFlag{
|
var OfflineFlag = &cli.BoolFlag{
|
||||||
Name: "offline, o",
|
Name: "offline",
|
||||||
|
Aliases: []string{"o"},
|
||||||
Destination: &Offline,
|
Destination: &Offline,
|
||||||
Usage: "Prefer offline & filesystem access when possible",
|
Usage: "Prefer offline & filesystem access when possible",
|
||||||
}
|
}
|
||||||
@ -113,7 +124,8 @@ var ReleaseNotes bool
|
|||||||
|
|
||||||
// ReleaseNotesFlag turns on/off printing only release notes when upgrading.
|
// ReleaseNotesFlag turns on/off printing only release notes when upgrading.
|
||||||
var ReleaseNotesFlag = &cli.BoolFlag{
|
var ReleaseNotesFlag = &cli.BoolFlag{
|
||||||
Name: "releasenotes, r",
|
Name: "releasenotes",
|
||||||
|
Aliases: []string{"r"},
|
||||||
Destination: &ReleaseNotes,
|
Destination: &ReleaseNotes,
|
||||||
Usage: "Only show release notes",
|
Usage: "Only show release notes",
|
||||||
}
|
}
|
||||||
@ -123,7 +135,8 @@ var MachineReadable bool
|
|||||||
|
|
||||||
// MachineReadableFlag turns on/off machine readable output where supported
|
// MachineReadableFlag turns on/off machine readable output where supported
|
||||||
var MachineReadableFlag = &cli.BoolFlag{
|
var MachineReadableFlag = &cli.BoolFlag{
|
||||||
Name: "machine, m",
|
Name: "machine",
|
||||||
|
Aliases: []string{"m"},
|
||||||
Destination: &MachineReadable,
|
Destination: &MachineReadable,
|
||||||
Usage: "Output in a machine-readable format (where supported)",
|
Usage: "Output in a machine-readable format (where supported)",
|
||||||
}
|
}
|
||||||
@ -133,49 +146,56 @@ var RC bool
|
|||||||
|
|
||||||
// RCFlag chooses the latest release candidate for install
|
// RCFlag chooses the latest release candidate for install
|
||||||
var RCFlag = &cli.BoolFlag{
|
var RCFlag = &cli.BoolFlag{
|
||||||
Name: "rc, r",
|
Name: "rc",
|
||||||
|
Aliases: []string{"r"},
|
||||||
Destination: &RC,
|
Destination: &RC,
|
||||||
Usage: "Install the latest release candidate",
|
Usage: "Install the latest release candidate",
|
||||||
}
|
}
|
||||||
|
|
||||||
var Major bool
|
var Major bool
|
||||||
var MajorFlag = &cli.BoolFlag{
|
var MajorFlag = &cli.BoolFlag{
|
||||||
Name: "major, x",
|
Name: "major",
|
||||||
|
Aliases: []string{"x"},
|
||||||
Usage: "Increase the major part of the version",
|
Usage: "Increase the major part of the version",
|
||||||
Destination: &Major,
|
Destination: &Major,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Minor bool
|
var Minor bool
|
||||||
var MinorFlag = &cli.BoolFlag{
|
var MinorFlag = &cli.BoolFlag{
|
||||||
Name: "minor, y",
|
Name: "minor",
|
||||||
|
Aliases: []string{"y"},
|
||||||
Usage: "Increase the minor part of the version",
|
Usage: "Increase the minor part of the version",
|
||||||
Destination: &Minor,
|
Destination: &Minor,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Patch bool
|
var Patch bool
|
||||||
var PatchFlag = &cli.BoolFlag{
|
var PatchFlag = &cli.BoolFlag{
|
||||||
Name: "patch, z",
|
Name: "patch",
|
||||||
|
Aliases: []string{"z"},
|
||||||
Usage: "Increase the patch part of the version",
|
Usage: "Increase the patch part of the version",
|
||||||
Destination: &Patch,
|
Destination: &Patch,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Dry bool
|
var Dry bool
|
||||||
var DryFlag = &cli.BoolFlag{
|
var DryFlag = &cli.BoolFlag{
|
||||||
Name: "dry-run, r",
|
Name: "dry-run",
|
||||||
|
Aliases: []string{"r"},
|
||||||
Usage: "Only reports changes that would be made",
|
Usage: "Only reports changes that would be made",
|
||||||
Destination: &Dry,
|
Destination: &Dry,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Publish bool
|
var Publish bool
|
||||||
var PublishFlag = &cli.BoolFlag{
|
var PublishFlag = &cli.BoolFlag{
|
||||||
Name: "publish, p",
|
Name: "publish",
|
||||||
|
Aliases: []string{"p"},
|
||||||
Usage: "Publish changes to git.coopcloud.tech",
|
Usage: "Publish changes to git.coopcloud.tech",
|
||||||
Destination: &Publish,
|
Destination: &Publish,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Domain string
|
var Domain string
|
||||||
var DomainFlag = &cli.StringFlag{
|
var DomainFlag = &cli.StringFlag{
|
||||||
Name: "domain, D",
|
Name: "domain",
|
||||||
|
Aliases: []string{"D"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Choose a domain name",
|
Usage: "Choose a domain name",
|
||||||
Destination: &Domain,
|
Destination: &Domain,
|
||||||
@ -183,7 +203,8 @@ var DomainFlag = &cli.StringFlag{
|
|||||||
|
|
||||||
var NewAppServer string
|
var NewAppServer string
|
||||||
var NewAppServerFlag = &cli.StringFlag{
|
var NewAppServerFlag = &cli.StringFlag{
|
||||||
Name: "server, s",
|
Name: "server",
|
||||||
|
Aliases: []string{"s"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Show apps of a specific server",
|
Usage: "Show apps of a specific server",
|
||||||
Destination: &NewAppServer,
|
Destination: &NewAppServer,
|
||||||
@ -191,21 +212,24 @@ var NewAppServerFlag = &cli.StringFlag{
|
|||||||
|
|
||||||
var NoDomainChecks bool
|
var NoDomainChecks bool
|
||||||
var NoDomainChecksFlag = &cli.BoolFlag{
|
var NoDomainChecksFlag = &cli.BoolFlag{
|
||||||
Name: "no-domain-checks, D",
|
Name: "no-domain-checks",
|
||||||
|
Aliases: []string{"D"},
|
||||||
Usage: "Disable public DNS checks",
|
Usage: "Disable public DNS checks",
|
||||||
Destination: &NoDomainChecks,
|
Destination: &NoDomainChecks,
|
||||||
}
|
}
|
||||||
|
|
||||||
var StdErrOnly bool
|
var StdErrOnly bool
|
||||||
var StdErrOnlyFlag = &cli.BoolFlag{
|
var StdErrOnlyFlag = &cli.BoolFlag{
|
||||||
Name: "stderr, s",
|
Name: "stderr",
|
||||||
|
Aliases: []string{"s"},
|
||||||
Usage: "Only tail stderr",
|
Usage: "Only tail stderr",
|
||||||
Destination: &StdErrOnly,
|
Destination: &StdErrOnly,
|
||||||
}
|
}
|
||||||
|
|
||||||
var SinceLogs string
|
var SinceLogs string
|
||||||
var SinceLogsFlag = &cli.StringFlag{
|
var SinceLogsFlag = &cli.StringFlag{
|
||||||
Name: "since, S",
|
Name: "since",
|
||||||
|
Aliases: []string{"S"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "tail logs since YYYY-MM-DDTHH:MM:SSZ",
|
Usage: "tail logs since YYYY-MM-DDTHH:MM:SSZ",
|
||||||
Destination: &SinceLogs,
|
Destination: &SinceLogs,
|
||||||
@ -213,49 +237,56 @@ var SinceLogsFlag = &cli.StringFlag{
|
|||||||
|
|
||||||
var DontWaitConverge bool
|
var DontWaitConverge bool
|
||||||
var DontWaitConvergeFlag = &cli.BoolFlag{
|
var DontWaitConvergeFlag = &cli.BoolFlag{
|
||||||
Name: "no-converge-checks, c",
|
Name: "no-converge-checks",
|
||||||
|
Aliases: []string{"c"},
|
||||||
Usage: "Don't wait for converge logic checks",
|
Usage: "Don't wait for converge logic checks",
|
||||||
Destination: &DontWaitConverge,
|
Destination: &DontWaitConverge,
|
||||||
}
|
}
|
||||||
|
|
||||||
var Watch bool
|
var Watch bool
|
||||||
var WatchFlag = &cli.BoolFlag{
|
var WatchFlag = &cli.BoolFlag{
|
||||||
Name: "watch, w",
|
Name: "watch",
|
||||||
|
Aliases: []string{"w"},
|
||||||
Usage: "Watch status by polling repeatedly",
|
Usage: "Watch status by polling repeatedly",
|
||||||
Destination: &Watch,
|
Destination: &Watch,
|
||||||
}
|
}
|
||||||
|
|
||||||
var OnlyErrors bool
|
var OnlyErrors bool
|
||||||
var OnlyErrorFlag = &cli.BoolFlag{
|
var OnlyErrorFlag = &cli.BoolFlag{
|
||||||
Name: "errors, e",
|
Name: "errors",
|
||||||
|
Aliases: []string{"e"},
|
||||||
Usage: "Only show errors",
|
Usage: "Only show errors",
|
||||||
Destination: &OnlyErrors,
|
Destination: &OnlyErrors,
|
||||||
}
|
}
|
||||||
|
|
||||||
var SkipUpdates bool
|
var SkipUpdates bool
|
||||||
var SkipUpdatesFlag = &cli.BoolFlag{
|
var SkipUpdatesFlag = &cli.BoolFlag{
|
||||||
Name: "skip-updates, s",
|
Name: "skip-updates",
|
||||||
|
Aliases: []string{"s"},
|
||||||
Usage: "Skip updating recipe repositories",
|
Usage: "Skip updating recipe repositories",
|
||||||
Destination: &SkipUpdates,
|
Destination: &SkipUpdates,
|
||||||
}
|
}
|
||||||
|
|
||||||
var AllTags bool
|
var AllTags bool
|
||||||
var AllTagsFlag = &cli.BoolFlag{
|
var AllTagsFlag = &cli.BoolFlag{
|
||||||
Name: "all-tags, a",
|
Name: "all-tags",
|
||||||
|
Aliases: []string{"a"},
|
||||||
Usage: "List all tags, not just upgrades",
|
Usage: "List all tags, not just upgrades",
|
||||||
Destination: &AllTags,
|
Destination: &AllTags,
|
||||||
}
|
}
|
||||||
|
|
||||||
var LocalCmd bool
|
var LocalCmd bool
|
||||||
var LocalCmdFlag = &cli.BoolFlag{
|
var LocalCmdFlag = &cli.BoolFlag{
|
||||||
Name: "local, l",
|
Name: "local",
|
||||||
|
Aliases: []string{"l"},
|
||||||
Usage: "Run command locally",
|
Usage: "Run command locally",
|
||||||
Destination: &LocalCmd,
|
Destination: &LocalCmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
var RemoteUser string
|
var RemoteUser string
|
||||||
var RemoteUserFlag = &cli.StringFlag{
|
var RemoteUserFlag = &cli.StringFlag{
|
||||||
Name: "user, u",
|
Name: "user",
|
||||||
|
Aliases: []string{"u"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "User to run command within a service context",
|
Usage: "User to run command within a service context",
|
||||||
Destination: &RemoteUser,
|
Destination: &RemoteUser,
|
||||||
@ -263,7 +294,8 @@ var RemoteUserFlag = &cli.StringFlag{
|
|||||||
|
|
||||||
var GitName string
|
var GitName string
|
||||||
var GitNameFlag = &cli.StringFlag{
|
var GitNameFlag = &cli.StringFlag{
|
||||||
Name: "git-name, gn",
|
Name: "git-name",
|
||||||
|
Aliases: []string{"gn"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Git (user) name to do commits with",
|
Usage: "Git (user) name to do commits with",
|
||||||
Destination: &GitName,
|
Destination: &GitName,
|
||||||
@ -271,7 +303,8 @@ var GitNameFlag = &cli.StringFlag{
|
|||||||
|
|
||||||
var GitEmail string
|
var GitEmail string
|
||||||
var GitEmailFlag = &cli.StringFlag{
|
var GitEmailFlag = &cli.StringFlag{
|
||||||
Name: "git-email, ge",
|
Name: "git-email",
|
||||||
|
Aliases: []string{"ge"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Git email name to do commits with",
|
Usage: "Git email name to do commits with",
|
||||||
Destination: &GitEmail,
|
Destination: &GitEmail,
|
||||||
@ -279,7 +312,8 @@ var GitEmailFlag = &cli.StringFlag{
|
|||||||
|
|
||||||
var AllServices bool
|
var AllServices bool
|
||||||
var AllServicesFlag = &cli.BoolFlag{
|
var AllServicesFlag = &cli.BoolFlag{
|
||||||
Name: "all-services, a",
|
Name: "all-services",
|
||||||
|
Aliases: []string{"a"},
|
||||||
Usage: "Restart all services",
|
Usage: "Restart all services",
|
||||||
Destination: &AllServices,
|
Destination: &AllServices,
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ShowSubcommandHelpAndError exits the program on error, logs the error to the
|
// ShowSubcommandHelpAndError exits the program on error, logs the error to the
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidateRecipe ensures the recipe arg is valid.
|
// ValidateRecipe ensures the recipe arg is valid.
|
||||||
@ -125,9 +125,9 @@ func ValidateDomain(c *cli.Context) string {
|
|||||||
|
|
||||||
// ValidateSubCmdFlags ensures flag order conforms to correct order
|
// ValidateSubCmdFlags ensures flag order conforms to correct order
|
||||||
func ValidateSubCmdFlags(c *cli.Context) bool {
|
func ValidateSubCmdFlags(c *cli.Context) bool {
|
||||||
for argIdx, arg := range c.Args() {
|
for argIdx, arg := range c.Args().Slice() {
|
||||||
if !strings.HasPrefix(arg, "--") {
|
if !strings.HasPrefix(arg, "--") {
|
||||||
for _, flag := range c.Args()[argIdx:] {
|
for _, flag := range c.Args().Slice()[argIdx:] {
|
||||||
if strings.HasPrefix(flag, "--") {
|
if strings.HasPrefix(flag, "--") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
gitPkg "coopcloud.tech/abra/pkg/git"
|
gitPkg "coopcloud.tech/abra/pkg/git"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var recipeDiffCommand = cli.Command{
|
var recipeDiffCommand = cli.Command{
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var recipeFetchCommand = cli.Command{
|
var recipeFetchCommand = cli.Command{
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/lint"
|
"coopcloud.tech/abra/pkg/lint"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var recipeLintCommand = cli.Command{
|
var recipeLintCommand = cli.Command{
|
||||||
|
@ -10,12 +10,13 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var pattern string
|
var pattern string
|
||||||
var patternFlag = &cli.StringFlag{
|
var patternFlag = &cli.StringFlag{
|
||||||
Name: "pattern, p",
|
Name: "pattern",
|
||||||
|
Aliases: []string{"p"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Simple string to filter recipes",
|
Usage: "Simple string to filter recipes",
|
||||||
Destination: &pattern,
|
Destination: &pattern,
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/git"
|
"coopcloud.tech/abra/pkg/git"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// recipeMetadata is the recipe metadata for the README.md
|
// recipeMetadata is the recipe metadata for the README.md
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package recipe
|
package recipe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RecipeCommand defines all recipe related sub-commands.
|
// RecipeCommand defines all recipe related sub-commands.
|
||||||
@ -19,16 +19,16 @@ for you.
|
|||||||
Anyone who uses a recipe can become a maintainer. Maintainers typically make
|
Anyone who uses a recipe can become a maintainer. Maintainers typically make
|
||||||
sure the recipe is in good working order and the config upgraded in a timely
|
sure the recipe is in good working order and the config upgraded in a timely
|
||||||
manner.`,
|
manner.`,
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
recipeFetchCommand,
|
&recipeFetchCommand,
|
||||||
recipeLintCommand,
|
&recipeLintCommand,
|
||||||
recipeListCommand,
|
&recipeListCommand,
|
||||||
recipeNewCommand,
|
&recipeNewCommand,
|
||||||
recipeReleaseCommand,
|
&recipeReleaseCommand,
|
||||||
recipeSyncCommand,
|
&recipeSyncCommand,
|
||||||
recipeUpgradeCommand,
|
&recipeUpgradeCommand,
|
||||||
recipeVersionCommand,
|
&recipeVersionCommand,
|
||||||
recipeResetCommand,
|
&recipeResetCommand,
|
||||||
recipeDiffCommand,
|
&recipeDiffCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/distribution/reference"
|
"github.com/distribution/reference"
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var recipeReleaseCommand = cli.Command{
|
var recipeReleaseCommand = cli.Command{
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var recipeResetCommand = cli.Command{
|
var recipeResetCommand = cli.Command{
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
"github.com/go-git/go-git/v5/plumbing"
|
"github.com/go-git/go-git/v5/plumbing"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var recipeSyncCommand = cli.Command{
|
var recipeSyncCommand = cli.Command{
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
"coopcloud.tech/tagcmp"
|
"coopcloud.tech/tagcmp"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/distribution/reference"
|
"github.com/distribution/reference"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type imgPin struct {
|
type imgPin struct {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func sortServiceByName(versions [][]string) func(i, j int) bool {
|
func sortServiceByName(versions [][]string) func(i, j int) bool {
|
||||||
|
@ -13,12 +13,13 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/server"
|
"coopcloud.tech/abra/pkg/server"
|
||||||
sshPkg "coopcloud.tech/abra/pkg/ssh"
|
sshPkg "coopcloud.tech/abra/pkg/ssh"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var local bool
|
var local bool
|
||||||
var localFlag = &cli.BoolFlag{
|
var localFlag = &cli.BoolFlag{
|
||||||
Name: "local, l",
|
Name: "local",
|
||||||
|
Aliases: []string{"l"},
|
||||||
Usage: "Use local server",
|
Usage: "Use local server",
|
||||||
Destination: &local,
|
Destination: &local,
|
||||||
}
|
}
|
||||||
@ -131,7 +132,7 @@ of your ~/.ssh/config. Checks for a valid online domain will be skipped:
|
|||||||
Before: internal.SubCommandBefore,
|
Before: internal.SubCommandBefore,
|
||||||
ArgsUsage: "<name>",
|
ArgsUsage: "<name>",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
if len(c.Args()) > 0 && local || !internal.ValidateSubCmdFlags(c) {
|
if c.Args().Len() > 0 && local || !internal.ValidateSubCmdFlags(c) {
|
||||||
err := errors.New("cannot use <name> and --local together")
|
err := errors.New("cannot use <name> and --local together")
|
||||||
internal.ShowSubcommandHelpAndError(c, err)
|
internal.ShowSubcommandHelpAndError(c, err)
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/docker/cli/cli/connhelper/ssh"
|
"github.com/docker/cli/cli/connhelper/ssh"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var serverListCommand = cli.Command{
|
var serverListCommand = cli.Command{
|
||||||
|
@ -9,13 +9,14 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var allFilter bool
|
var allFilter bool
|
||||||
|
|
||||||
var allFilterFlag = &cli.BoolFlag{
|
var allFilterFlag = &cli.BoolFlag{
|
||||||
Name: "all, a",
|
Name: "all",
|
||||||
|
Aliases: []string{"a"},
|
||||||
Usage: "Remove all unused images not just dangling ones",
|
Usage: "Remove all unused images not just dangling ones",
|
||||||
Destination: &allFilter,
|
Destination: &allFilter,
|
||||||
}
|
}
|
||||||
@ -23,7 +24,8 @@ var allFilterFlag = &cli.BoolFlag{
|
|||||||
var volumesFilter bool
|
var volumesFilter bool
|
||||||
|
|
||||||
var volumesFilterFlag = &cli.BoolFlag{
|
var volumesFilterFlag = &cli.BoolFlag{
|
||||||
Name: "volumes, v",
|
Name: "volumes",
|
||||||
|
Aliases: []string{"v"},
|
||||||
Usage: "Prune volumes. This will remove app data, Be Careful!",
|
Usage: "Prune volumes. This will remove app data, Be Careful!",
|
||||||
Destination: &volumesFilter,
|
Destination: &volumesFilter,
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/config"
|
"coopcloud.tech/abra/pkg/config"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var serverRemoveCommand = cli.Command{
|
var serverRemoveCommand = cli.Command{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServerCommand defines the `abra server` command and its subcommands
|
// ServerCommand defines the `abra server` command and its subcommands
|
||||||
@ -9,10 +9,10 @@ var ServerCommand = cli.Command{
|
|||||||
Name: "server",
|
Name: "server",
|
||||||
Aliases: []string{"s"},
|
Aliases: []string{"s"},
|
||||||
Usage: "Manage servers",
|
Usage: "Manage servers",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
serverAddCommand,
|
&serverAddCommand,
|
||||||
serverListCommand,
|
&serverListCommand,
|
||||||
serverRemoveCommand,
|
&serverRemoveCommand,
|
||||||
serverPruneCommand,
|
&serverPruneCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -23,21 +23,23 @@ import (
|
|||||||
dockerclient "github.com/docker/docker/client"
|
dockerclient "github.com/docker/docker/client"
|
||||||
|
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
const SERVER = "localhost"
|
const SERVER = "localhost"
|
||||||
|
|
||||||
var majorUpdate bool
|
var majorUpdate bool
|
||||||
var majorFlag = &cli.BoolFlag{
|
var majorFlag = &cli.BoolFlag{
|
||||||
Name: "major, m",
|
Name: "major",
|
||||||
|
Aliases: []string{"m"},
|
||||||
Usage: "Also check for major updates",
|
Usage: "Also check for major updates",
|
||||||
Destination: &majorUpdate,
|
Destination: &majorUpdate,
|
||||||
}
|
}
|
||||||
|
|
||||||
var updateAll bool
|
var updateAll bool
|
||||||
var allFlag = &cli.BoolFlag{
|
var allFlag = &cli.BoolFlag{
|
||||||
Name: "all, a",
|
Name: "all",
|
||||||
|
Aliases: []string{"a"},
|
||||||
Usage: "Update all deployed apps",
|
Usage: "Update all deployed apps",
|
||||||
Destination: &updateAll,
|
Destination: &updateAll,
|
||||||
}
|
}
|
||||||
@ -480,9 +482,9 @@ func newAbraApp(version, commit string) *cli.App {
|
|||||||
|_|
|
|_|
|
||||||
`,
|
`,
|
||||||
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
|
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
|
||||||
Commands: []cli.Command{
|
Commands: []*cli.Command{
|
||||||
Notify,
|
&Notify,
|
||||||
UpgradeApp,
|
&UpgradeApp,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
go.mod
3
go.mod
@ -18,6 +18,7 @@ require (
|
|||||||
github.com/olekukonko/tablewriter v0.0.5
|
github.com/olekukonko/tablewriter v0.0.5
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/schollz/progressbar/v3 v3.14.4
|
github.com/schollz/progressbar/v3 v3.14.4
|
||||||
|
github.com/urfave/cli/v2 v2.27.2
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
gotest.tools/v3 v3.5.1
|
gotest.tools/v3 v3.5.1
|
||||||
)
|
)
|
||||||
@ -91,6 +92,7 @@ require (
|
|||||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||||
|
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
|
||||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect
|
||||||
@ -134,7 +136,6 @@ require (
|
|||||||
github.com/spf13/cobra v1.8.1 // indirect
|
github.com/spf13/cobra v1.8.1 // indirect
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
github.com/theupdateframework/notary v0.7.0 // indirect
|
github.com/theupdateframework/notary v0.7.0 // indirect
|
||||||
github.com/urfave/cli v1.22.15
|
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
golang.org/x/sys v0.22.0
|
golang.org/x/sys v0.22.0
|
||||||
)
|
)
|
||||||
|
13
go.sum
13
go.sum
@ -49,7 +49,6 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
|
|||||||
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
|
||||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
@ -861,9 +860,6 @@ github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+
|
|||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
|
||||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
|
||||||
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
@ -871,9 +867,6 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
|
|||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
|
||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||||
@ -893,8 +886,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
|
|||||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM=
|
github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI=
|
||||||
github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0=
|
github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM=
|
||||||
github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI=
|
github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI=
|
||||||
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
|
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
|
||||||
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
|
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
|
||||||
@ -916,6 +909,8 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17
|
|||||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
|
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
|
||||||
|
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/app"
|
"coopcloud.tech/abra/pkg/app"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AppNameComplete copletes app names.
|
// AppNameComplete copletes app names.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user