Пример #1
0
Файл: watch.go Проект: mmb/boosh
func watch(name string) {
	deployer := deployer.New(cloudformation.NewFromEnv())

	events := make(chan *cloudformation.StackEvent)

	go deployer.Watch(events, name)

	ok := streamEvents(events)
	if !ok {
		fmt.Println()
		fatal(ansi.Color("formation failed and was rolled back", "yellow"))
	}
}
Пример #2
0
func deploy(name string, source io.Reader) {
	template, err := ioutil.ReadAll(source)
	if err != nil {
		fatal(err)
	}

	deployer := deployer.New(cloudformation.NewFromEnv())

	events, err := deployer.Deploy(name, template)
	if err != nil {
		panic(err)
	}

	ok := streamEvents(events)
	if !ok {
		fmt.Println()
		fatal(ansi.Color("formation failed and was rolled back", "yellow"))
	}
}