diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 62660970..a429442e 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -10,6 +10,7 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/step" + "github.com/sirupsen/logrus" ) // CreateStage prepares the stage for execution. @@ -141,6 +142,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) // // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip if step.Skip(_step, c.build, c.repo) { + logrus.Infof("Skipping step %s due to ruleset", _step.Name) continue } diff --git a/executor/local/build.go b/executor/local/build.go index b5d24aa0..31d2c5ef 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -13,6 +13,7 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/worker/internal/build" "github.com/go-vela/worker/internal/step" + "github.com/sirupsen/logrus" ) // CreateBuild configures the build for execution. @@ -274,6 +275,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip if step.Skip(_step, c.build, c.repo) { + logrus.Infof("Skipping step %s due to ruleset", _step.Name) continue } diff --git a/executor/local/step.go b/executor/local/step.go index d2202419..dc34bb12 100644 --- a/executor/local/step.go +++ b/executor/local/step.go @@ -31,18 +31,6 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error return err } - // create a library step object to facilitate injecting environment as early as possible - // (PlanStep is too late to inject environment vars for the kubernetes runtime). - _step := library.StepFromBuildContainer(c.build, ctn) - - // update the step container environment - // - // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Environment - err = step.Environment(ctn, c.build, c.repo, _step, c.Version) - if err != nil { - return err - } - // substitute container configuration // // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Substitute @@ -56,19 +44,16 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error // PlanStep prepares the step for execution. func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { + // early exit if container is nil + if ctn.Empty() { + return fmt.Errorf("empty container provided") + } + // create the library step object _step := library.StepFromBuildContainer(c.build, ctn) _step.SetStatus(constants.StatusRunning) _step.SetStarted(time.Now().UTC().Unix()) - // update the step container environment - // - // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Environment - err := step.Environment(ctn, c.build, c.repo, _step, c.Version) - if err != nil { - return err - } - // add the step to the client map c.steps.Store(ctn.ID, _step)