Files
abra/cli/server/remove.go
decentral1se 99160967a8
All checks were successful
continuous-integration/drone/push Build is passing
refactor: domainName as arg and doc strings
See coop-cloud/organising#163.
2021-09-10 15:04:01 +02:00

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
},
}