打印 service 列表
(services map[string]compose.Service)
| 451 | |
| 452 | // 打印 service 列表 |
| 453 | func printServices(services map[string]compose.Service) { |
| 454 | w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0) |
| 455 | fmt.Fprintln(w, "Service\tImage\tPorts\t") |
| 456 | for serviceName, service := range services { |
| 457 | line := fmt.Sprintf("%v\t%v\t%v\t", serviceName, service.Image, strings.Join(service.Ports, ";")) |
| 458 | fmt.Fprintln(w, line) |
| 459 | } |
| 460 | w.Flush() |
| 461 | } |
| 462 | |
| 463 | // docker-compose 对应的容器是否运行 |
| 464 | func isRemoteDockerComposeRunning(sshRemote common.SSHRemote, workingDir string, serviceNames []string) (isDockerComposeRunning bool, err error) { |
no test coverage detected