Пример #1
0
func ProjectPs(p *project.Project, c *cli.Context) {
	allInfo := project.InfoSet{}
	for name := range p.Configs {
		service, err := p.CreateService(name)
		if err != nil {
			logrus.Fatal(err)
		}

		info, err := service.Info()
		if err != nil {
			logrus.Fatal(err)
		}

		allInfo = append(allInfo, info...)
	}

	os.Stdout.WriteString(allInfo.String())
}
Пример #2
0
// ProjectPs lists the containers.
func ProjectPs(p *project.Project, c *cli.Context) {
	allInfo := project.InfoSet{}
	qFlag := c.Bool("q")
	for _, name := range p.Configs.Keys() {
		service, err := p.CreateService(name)
		if err != nil {
			logrus.Fatal(err)
		}

		info, err := service.Info(qFlag)
		if err != nil {
			logrus.Fatal(err)
		}

		allInfo = append(allInfo, info...)
	}

	os.Stdout.WriteString(allInfo.String(!qFlag))
}
Пример #3
0
func (c *ComposeWrapper) PS(quiet bool) error {
	allInfo := project.InfoSet{}

	for name := range c.project.Configs {
		service, err := c.project.CreateService(name)
		if err != nil {
			return err
		}

		info, err := service.Info(quiet)
		if err != nil {
			return err
		}

		allInfo = append(allInfo, info...)
	}
	os.Stdout.WriteString(allInfo.String(!quiet))
	return nil
}