Example #1
0
File: deploy.go Project: ch3lo/yale
func deployBefore(c *cli.Context) error {
	if c.String("image") == "" {
		return errors.New("El nombre de la imagen esta vacio")
	}

	if c.String("tag") == "" {
		return errors.New("El TAG de la imagen esta vacio")
	}

	if c.String("smoke-request") == "" {
		return errors.New("El endpoint de Smoke Test esta vacio")
	}

	if c.String("memory") != "" {
		if _, err := bytefmt.ToMegabytes(c.String("memory")); err != nil {
			return errors.New("Valor del parĂ¡metro memory invalido")
		}

	}

	for _, file := range c.StringSlice("env-file") {
		if err := util.FileExists(file); err != nil {
			return errors.New(fmt.Sprintf("El archivo %s con variables de entorno no existe", file))
		}
	}

	return nil
}
Example #2
0
File: cli.go Project: ch3lo/yale
func dockerCfgPath() string {
	p := path.Join(os.Getenv("HOME"), ".docker", "config.json")
	if err := util.FileExists(p); err != nil {
		p = path.Join(os.Getenv("HOME"), ".dockercfg")
	}

	return p
}