diff --git a/pkg/docker/build.go b/pkg/docker/build.go index 7efa606..bb707d7 100644 --- a/pkg/docker/build.go +++ b/pkg/docker/build.go @@ -7,6 +7,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "io" "os" "os/exec" @@ -108,7 +109,7 @@ func printBuildLogs(dst io.Writer, rd io.Reader) error { scanner := bufio.NewScanner(rd) for scanner.Scan() { lastLine = scanner.Text() - io.Copy(dst, rd) + fmt.Fprintln(dst, lastLine) } errLine := &ErrorLine{} diff --git a/pkg/process/step.go b/pkg/process/step.go index edc5409..ea68873 100644 --- a/pkg/process/step.go +++ b/pkg/process/step.go @@ -17,14 +17,18 @@ func handleSignal() { go func() { for sig := range c { fmt.Println("Stopped process: " + sig.String()) - if logSpinner.Enabled() { - logSpinner.Stop() - } + terminateSpinner() os.Exit(1) } }() } +func terminateSpinner() { + if logSpinner.Enabled() { + logSpinner.Stop() + } +} + func start(step *api.Step, status *api.StepStatus, lc api.LaunchConfig) error { go handleSignal() @@ -32,16 +36,19 @@ func start(step *api.Step, status *api.StepStatus, lc api.LaunchConfig) error { baseStep, err := step.GetBaseStep(lc) if err != nil { + terminateSpinner() return err } if err := build(step, baseStep, status, lc); err != nil { status.Phase = api.StepPhaseFailed + terminateSpinner() return err } if step.Push && len(step.Platforms) == 0 { if err := push(step, status, lc); err != nil { status.Phase = api.StepPhaseFailed + terminateSpinner() return err } }