refactor!: migrate to urfave/cli v1
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Better flexible flags handling.
This commit is contained in:
@ -1,18 +1,25 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/client"
|
||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var appUndeployCommand = &cli.Command{
|
||||
var appUndeployCommand = cli.Command{
|
||||
Name: "undeploy",
|
||||
Aliases: []string{"un"},
|
||||
Usage: "Undeploy an app",
|
||||
Flags: []cli.Flag{
|
||||
internal.DebugFlag,
|
||||
internal.NoInputFlag,
|
||||
},
|
||||
Before: internal.SubCommandBefore,
|
||||
Usage: "Undeploy an app",
|
||||
Description: `
|
||||
This does not destroy any of the application data. However, you should remain
|
||||
vigilant, as your swarm installation will consider any previously attached
|
||||
@ -29,7 +36,7 @@ volumes as eligiblef or pruning once undeployed.
|
||||
|
||||
logrus.Debugf("checking whether %s is already deployed", stackName)
|
||||
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(c.Context, cl, stackName)
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(context.Background(), cl, stackName)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
@ -43,7 +50,7 @@ volumes as eligiblef or pruning once undeployed.
|
||||
}
|
||||
|
||||
rmOpts := stack.Remove{Namespaces: []string{app.StackName()}}
|
||||
if err := stack.RunRemove(c.Context, cl, rmOpts); err != nil {
|
||||
if err := stack.RunRemove(context.Background(), cl, rmOpts); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user