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

View File

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