docs: server CLI documentation

This commit is contained in:
decentral1se 2021-08-02 00:30:03 +02:00
parent 8a5ee68b7b
commit a1bce4661b
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 22 additions and 14 deletions

View File

@ -55,7 +55,7 @@ var serverListCommand = &cli.Command{
var serverAddCommand = &cli.Command{
Name: "add",
Usage: "Add a server, reachable on <host>.",
Usage: "Add a new server, reachable on <host>.",
ArgsUsage: "<host> [<user>] [<port>]",
Description: "[<user>], [<port>] SSH connection details",
Action: func(c *cli.Context) error {
@ -74,8 +74,8 @@ var serverAddCommand = &cli.Command{
var serverNewCommand = &cli.Command{
Name: "new",
Usage: "Creates a VPS from a provider in your terminal!",
Description: "Use a provider plugin to create an actual new server resource (VPS or otherwise) which can then be used to house a new Co-op Cloud installation.",
Usage: "Create a new server using a 3rd party provider",
Description: "Use a provider plugin to create a new server which can then be used to house a new Co-op Cloud installation.",
ArgsUsage: "<provider>",
HideHelp: true,
}
@ -83,7 +83,7 @@ var serverNewCommand = &cli.Command{
var serverRemoveCommand = &cli.Command{
Name: "remove",
Aliases: []string{"rm", "delete"},
Usage: "Remove server <host>",
Usage: "Remove a locally-defined server",
HideHelp: true,
Action: func(c *cli.Context) error {
server := c.Args().First()
@ -96,16 +96,19 @@ var serverRemoveCommand = &cli.Command{
var serverInitCommand = &cli.Command{
Name: "init",
Usage: "Set up a server for Docker swarm",
Usage: "Initialise server for deploying apps",
HideHelp: true,
ArgsUsage: "<host>",
Description: `This initialisation explicitly chooses the "single host swarm" mode
which uses the default IPv4 address as the advertising address. This
can be re-configured later for more advanced use cases.
POWERED BY
docker swarm init
docker network create ...`,
Description: `
Initialise swarm mode on the target <host>.
This initialisation explicitly chooses the "single host swarm" mode which uses
the default IPv4 address as the advertising address. This can be re-configured
later for more advanced use cases.
`,
Action: func(c *cli.Context) error {
return nil
},
}
// Reminder: The list commands are in is the order they appear in the help menu
@ -113,7 +116,13 @@ var ServerCommand = &cli.Command{
Name: "server",
ArgsUsage: "<host>",
Usage: "Manage the servers that host your apps",
HideHelp: true,
Description: `
Manage the lifecycle of a server.
These commands support creating new servers using 3rd party integrations,
initialising existing servers to support Co-op Cloud deployments and managing
the connections to those servers.
`,
Subcommands: []*cli.Command{
serverNewCommand,
serverInitCommand,
@ -121,5 +130,4 @@ var ServerCommand = &cli.Command{
serverListCommand,
serverRemoveCommand,
},
Action: func(c *cli.Context) error { fmt.Println("server"); return nil },
}