commands

package
v0.0.0-...-8388630 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var All = []*Command{
	Docker,
	Hosts,
	IP,
	Proxy,
	Run,
}
View Source
var CreateHost = &Command{
	UsageLine: "create [-m MEMORY] [NAME]",
	Short:     "Create a host",
	Long: fmt.Sprintf(`Create a host.

You can optionally specify a name for the host - if not, it will be
named 'default', and 'deploy docker' commands will use it automatically.

You can also specify how much RAM the host should have with -m.
Valid amounts are %s.`, validSizes),
}
View Source
var Docker = &Command{
	UsageLine: "docker [-H HOST] [COMMAND...]",
	Short:     "Run a Docker command against a host",
	Long: `Run a Docker command against a host.

Wraps the 'docker' command-line tool - see the Docker website for reference:

    http://docs.docker.io/en/latest/reference/commandline/

You can optionally specify a host by name - if you don't, the default host
will be used.`,
}
View Source
var HostSubcommands = []*Command{
	CreateHost,
	RemoveHost,
}
View Source
var Hosts = &Command{
	UsageLine: "hosts",
	Short:     "Manage hosts",
	Long: `Manage hosts.

Usage: deploy hosts [COMMAND] [ARGS...]

Commands:
  ls          List hosts (default)
  create      Create a host
  rm          Remove a host

Run 'deploy hosts COMMAND -h' for more information on a command.
`,
}
View Source
var IP = &Command{
	UsageLine: "ip [NAME]",
	Short:     "Print a hosts's IP address to stdout",
	Long: `Print a hosts's IP address to stdout.

You can optionally specify which host - if you don't, the default
host (named 'default') will be assumed.
`,
}
View Source
var Proxy = &Command{
	UsageLine: "proxy [-H HOST] [LISTEN_URL]",
	Short:     "Start a local proxy to a host's Docker daemon",
	Long: `Start a local proxy to a host's Docker daemon.

By default, listens on a Unix socket at a random path, e.g.

    $ deploy proxy
    Started proxy at unix:///tmp/deploy-12345/deploy.sock

    $ docker -H unix:///tmp/deploy-12345/deploy.sock run ubuntu echo hello world
    hello world

Instead, you can specify a URL to listen on, which can be a socket or TCP address:

    $ deploy proxy unix:///path/to/socket
    $ deploy proxy tcp://localhost:1234
`,
}
View Source
var RemoveHost = &Command{
	UsageLine: "rm [-f] [NAME]",
	Short:     "Remove a host",
	Long: `Remove a host.

You can optionally specify which host to remove - if you don't, the default
host (named 'default') will be removed.

Set -f to bypass the confirmation step, at your peril.
`,
}
View Source
var Run = &Command{
	UsageLine: "run [-H HOST] COMMAND [ARGS...]",
	Short:     "Run a command with the DOCKER_HOST envvar set",
	Long: `Start a proxy to a Deploy.IO host and run a command locally
with the DOCKER_HOST environment variable set.

For example:

$ deploy run fig up

You can optionally specify which host - if you don't, the default
host (named 'default') will be assumed.
`,
}

Functions

func CallDocker

func CallDocker(args []string, dockerHost string) error

func GetDockerPath

func GetDockerPath() string

func GetHost

func GetHost(hostName string) (*api.Host, error)

func GetHostName

func GetHostName(args []string) (string, string)

func GetHostSize

func GetHostSize() (int, string)

func GetHumanHostName

func GetHumanHostName(hostName string) string

func RunCreateHost

func RunCreateHost(cmd *Command, args []string) error

func RunDocker

func RunDocker(cmd *Command, args []string) error

func RunHosts

func RunHosts(cmd *Command, args []string) error

func RunIP

func RunIP(cmd *Command, args []string) error

func RunRemoveHost

func RunRemoveHost(cmd *Command, args []string) error

func WithDockerProxy

func WithDockerProxy(listenURL, hostName string, callback func(string, string, string, string) error) error

Types

type Command

type Command struct {
	Run       func(cmd *Command, args []string) error
	UsageLine string
	Short     string
	Long      string
	Flag      flag.FlagSet
}

func (*Command) Name

func (c *Command) Name() string

func (*Command) Usage

func (c *Command) Usage()

func (*Command) UsageError

func (c *Command) UsageError(format string, args ...interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL