예제 #1
0
파일: app.go 프로젝트: aduermael/libcompose
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
}