Example #1
0
File: cmd.go Project: uniite/deis
// SSH opens an interactive shell on a machine in the cluster
func SSH(target string, cmd []string, b backend.Backend) error {

	if len(cmd) > 0 {
		return b.SSHExec(target, strings.Join(cmd, " "))
	}

	return b.SSH(target)
}
Example #2
0
File: cmd.go Project: uniite/deis
// Dock connects to the appropriate host and runs 'docker exec -it'.
func Dock(target string, cmd []string, b backend.Backend) error {

	c := "sh"
	if len(cmd) > 0 {
		c = strings.Join(cmd, " ")
	}

	execit := fmt.Sprintf("docker exec -it %s %s", target, c)

	return b.SSHExec(target, execit)
}