Ejemplo n.º 1
0
func AppCreate(configStore *config.Store, app, env string) error {
	// Don't allow creating runtime hosts entries
	if app == "hosts" {
		return fmt.Errorf("could not create app: %s", app)
	}

	created, err := configStore.CreateApp(app, env)

	if err != nil {
		return fmt.Errorf("could not create app: %s", err)
	}

	if created {
		log.Printf("Created %s in env %s.\n", app, env)
	} else {
		log.Printf("%s already exists in in env %s.", app, env)
	}
	return nil
}