31 lines
687 B
Go
31 lines
687 B
Go
package server
|
|
|
|
import (
|
|
"coopcloud.tech/abra/cli/internal"
|
|
"coopcloud.tech/abra/pkg/client"
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
var serverRemoveCommand = &cli.Command{
|
|
Name: "remove",
|
|
Aliases: []string{"rm"},
|
|
Usage: "Remove a server",
|
|
Description: `
|
|
This does not destroy the actual server. It simply removes it from Abra
|
|
internal bookkeeping so that it is not managed any more.
|
|
`,
|
|
HideHelp: true,
|
|
Action: func(c *cli.Context) error {
|
|
domainName := internal.ValidateDomain(c)
|
|
|
|
if err := client.DeleteContext(domainName); err != nil {
|
|
logrus.Fatal(err)
|
|
}
|
|
|
|
logrus.Infof("Server at '%s' has been forgotten", domainName)
|
|
|
|
return nil
|
|
},
|
|
}
|