2016-09-08 13:11:39 -04:00
|
|
|
package stack
|
|
|
|
|
|
|
|
import (
|
2017-04-17 18:07:56 -04:00
|
|
|
"github.com/docker/cli/cli"
|
|
|
|
"github.com/docker/cli/cli/command"
|
2016-09-08 13:11:39 -04:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2016-10-06 10:09:54 -04:00
|
|
|
// NewStackCommand returns a cobra command for `stack` subcommands
|
2017-10-11 12:18:27 -04:00
|
|
|
func NewStackCommand(dockerCli command.Cli) *cobra.Command {
|
2016-10-06 10:09:54 -04:00
|
|
|
cmd := &cobra.Command{
|
2017-10-25 12:59:32 -04:00
|
|
|
Use: "stack",
|
|
|
|
Short: "Manage Docker stacks",
|
|
|
|
Args: cli.NoArgs,
|
|
|
|
RunE: command.ShowHelp(dockerCli.Err()),
|
|
|
|
Annotations: map[string]string{"version": "1.25"},
|
2016-10-06 10:09:54 -04:00
|
|
|
}
|
|
|
|
cmd.AddCommand(
|
|
|
|
newDeployCommand(dockerCli),
|
|
|
|
newListCommand(dockerCli),
|
|
|
|
newRemoveCommand(dockerCli),
|
|
|
|
newServicesCommand(dockerCli),
|
|
|
|
newPsCommand(dockerCli),
|
|
|
|
)
|
|
|
|
return cmd
|
2016-09-08 13:11:39 -04:00
|
|
|
}
|
|
|
|
|
2016-10-06 10:09:54 -04:00
|
|
|
// NewTopLevelDeployCommand returns a command for `docker deploy`
|
2017-05-03 17:58:52 -04:00
|
|
|
func NewTopLevelDeployCommand(dockerCli command.Cli) *cobra.Command {
|
2016-10-06 10:09:54 -04:00
|
|
|
cmd := newDeployCommand(dockerCli)
|
|
|
|
// Remove the aliases at the top level
|
|
|
|
cmd.Aliases = []string{}
|
2017-10-25 12:59:32 -04:00
|
|
|
cmd.Annotations = map[string]string{"experimental": "", "version": "1.25"}
|
2016-10-06 10:09:54 -04:00
|
|
|
return cmd
|
2016-09-08 13:11:39 -04:00
|
|
|
}
|