Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ var specCmd = &cobra.Command{
buildModel, err := prog.Run()
tui.CheckErr(err)
if buildModel.(build.Model).Err != nil {
tui.CheckErr(fmt.Errorf("error building services"))
tui.CheckErr(fmt.Errorf("error building migration images"))
}
}
}
Expand Down
23 changes: 21 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,24 @@ var runCmd = &cobra.Command{

// non-interactive environment
for update := range allBuildUpdates {
if update.Status == project.ServiceBuildStatus_Error {
localCloud.Stop()
tui.CheckErr(fmt.Errorf("error building services"))
}

for _, line := range strings.Split(strings.TrimSuffix(update.Message, "\n"), "\n") {
fmt.Printf("%s [%s]: %s\n", update.ServiceName, update.Status, line)
}
}
} else {
prog := teax.NewProgram(build.NewModel(allBuildUpdates, "Building Services"))
// blocks but quits once the above updates channel is closed by the build process
_, err = prog.Run()
buildModel, err := prog.Run()
tui.CheckErr(err)
if buildModel.(build.Model).Err != nil {
localCloud.Stop()
tui.CheckErr(fmt.Errorf("error building services"))
}
}

websiteBuildUpdates, err := proj.BuildWebsites(loadEnv)
Expand All @@ -156,15 +165,25 @@ var runCmd = &cobra.Command{
if isNonInteractive() {
fmt.Println("building project websites")
for update := range websiteBuildUpdates {
if update.Status == project.ServiceBuildStatus_Error {
localCloud.Stop()
tui.CheckErr(fmt.Errorf("error building websites"))
}

for _, line := range strings.Split(strings.TrimSuffix(update.Message, "\n"), "\n") {
fmt.Printf("%s [%s]: %s\n", update.ServiceName, update.Status, line)
}
}
} else {
prog := teax.NewProgram(build.NewModel(websiteBuildUpdates, "Building Websites"))
// blocks but quits once the above updates channel is closed by the build process
_, err = prog.Run()
buildModel, err := prog.Run()
tui.CheckErr(err)

if buildModel.(build.Model).Err != nil {
localCloud.Stop()
tui.CheckErr(fmt.Errorf("error building websites"))
}
}
}

Expand Down
16 changes: 14 additions & 2 deletions cmd/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ var stackUpdateCmd = &cobra.Command{

// non-interactive environment
for update := range allBuildUpdates {
if update.Status == project.ServiceBuildStatus_Error {
tui.CheckErr(fmt.Errorf("error building services"))
}

for _, line := range strings.Split(strings.TrimSuffix(update.Message, "\n"), "\n") {
fmt.Printf("%s [%s]: %s\n", update.ServiceName, update.Status, line)
}
Expand Down Expand Up @@ -272,7 +276,7 @@ var stackUpdateCmd = &cobra.Command{
buildModel, err := prog.Run()
tui.CheckErr(err)
if buildModel.(build.Model).Err != nil {
tui.CheckErr(fmt.Errorf("error building services"))
tui.CheckErr(fmt.Errorf("error building migration images"))
}
}
}
Expand All @@ -284,15 +288,23 @@ var stackUpdateCmd = &cobra.Command{
if isNonInteractive() {
fmt.Println("building project websites")
for update := range websiteBuildUpdates {
if update.Status == project.ServiceBuildStatus_Error {
tui.CheckErr(fmt.Errorf("error building websites"))
}

for _, line := range strings.Split(strings.TrimSuffix(update.Message, "\n"), "\n") {
fmt.Printf("%s [%s]: %s\n", update.ServiceName, update.Status, line)
}
}
} else {
prog := teax.NewProgram(build.NewModel(websiteBuildUpdates, "Building Websites"))
// blocks but quits once the above updates channel is closed by the build process
_, err = prog.Run()
buildModel, err := prog.Run()
tui.CheckErr(err)

if buildModel.(build.Model).Err != nil {
tui.CheckErr(fmt.Errorf("error building websites"))
}
}
}

Expand Down