2016-06-08 13:47:46 -04:00
|
|
|
package stack
|
|
|
|
|
|
|
|
import (
|
2016-10-06 10:09:54 -04:00
|
|
|
"github.com/docker/docker/cli"
|
2016-09-08 14:54:01 -04:00
|
|
|
"github.com/docker/docker/cli/command"
|
2016-06-08 13:47:46 -04:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2016-10-06 10:09:54 -04:00
|
|
|
// NewStackCommand returns a cobra command for `stack` subcommands
|
2016-09-08 14:54:01 -04:00
|
|
|
func NewStackCommand(dockerCli *command.DockerCli) *cobra.Command {
|
2016-10-06 10:09:54 -04:00
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "stack",
|
|
|
|
Short: "Manage Docker stacks",
|
|
|
|
Args: cli.NoArgs,
|
2016-11-17 13:54:10 -05:00
|
|
|
RunE: dockerCli.ShowHelp,
|
|
|
|
Tags: map[string]string{"experimental": "", "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-06-08 13:47:46 -04:00
|
|
|
}
|
|
|
|
|
2016-10-06 10:09:54 -04:00
|
|
|
// NewTopLevelDeployCommand returns a command for `docker deploy`
|
2016-09-08 14:54:01 -04:00
|
|
|
func NewTopLevelDeployCommand(dockerCli *command.DockerCli) *cobra.Command {
|
2016-10-06 10:09:54 -04:00
|
|
|
cmd := newDeployCommand(dockerCli)
|
|
|
|
// Remove the aliases at the top level
|
|
|
|
cmd.Aliases = []string{}
|
|
|
|
return cmd
|
2016-06-08 13:47:46 -04:00
|
|
|
}
|