From c475ef41f931261cb97d455987ee49ed06cd63da Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 1 Aug 2022 09:16:49 -0500 Subject: [PATCH] fix(exec): make sure to call StreamBuild (#378) --- action/pipeline/exec.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/action/pipeline/exec.go b/action/pipeline/exec.go index 7010af38..61dbedc4 100644 --- a/action/pipeline/exec.go +++ b/action/pipeline/exec.go @@ -118,7 +118,8 @@ func (c *Config) Exec(client compiler.Engine) error { } // create a background context - ctx := context.Background() + ctx, done := context.WithCancel(context.Background()) + defer done() defer func() { // destroy the build with the executor @@ -140,6 +141,17 @@ func (c *Config) Exec(client compiler.Engine) error { return fmt.Errorf("unable to plan build: %w", err) } + // log/event streaming + go func() { + logrus.Debug("streaming build logs") + // start process to handle StreamRequests + // from Steps and Services + err = _executor.StreamBuild(ctx) + if err != nil { + logrus.Errorf("unable to stream build logs: %v", err) + } + }() + // assemble the build with the executor err = _executor.AssembleBuild(ctx) if err != nil {