func (r *Run) runDry(d tacks.Document) error { stack, err := d.Parse() if err != nil { return err } r.document = &d fmt.Fprintf(os.Stderr, stack) return nil }
func (r *Run) run(d tacks.Document) error { const null = "" e := d.Environment if e.Ask && !term.Confirm("Are you sure you to deploy to %q? ", r.Environment) { return errors.New("no confirmation received") } stack, err := d.Parse() if err != nil { return err } r.document = &d config := &aws.Config{ Region: r.Region, } // prefer region from tacks stack if e.Region != null { config.Region = e.Region } client := cf.New(config) switch e.Mode { case "create": return r.runCreate(client, d, stack) case "upsert": return r.runUpsert(client, d, stack) default: return fmt.Errorf(`unknown mode %q, supported are "create" and "upsert"`) } }