Skip to content

Commit

Permalink
fix: properly update success status (#59)
Browse files Browse the repository at this point in the history
* refactor: work directory set moved to compiler

* chore: update go-vela dependencies

* fix: properly update success status
  • Loading branch information
Neal authored Feb 17, 2020
1 parent 5ff6192 commit 701594f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions executor/linux/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ func (c *client) CreateBuild(ctx context.Context) error {
b.SetStatus(constants.StatusError)
}

// update the build fields
b.SetFinished(time.Now().UTC().Unix())

c.logger.Info("uploading build state")
// send API call to update the build
_, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b)
Expand All @@ -69,6 +66,8 @@ func (c *client) CreateBuild(ctx context.Context) error {
return fmt.Errorf("unable to upload start state: %w", err)
}

c.build = b

// TODO: make this better
init := new(pipeline.Container)
if len(p.Steps) > 0 {
Expand Down Expand Up @@ -288,9 +287,6 @@ func (c *client) CreateBuild(ctx context.Context) error {
l.SetData(append(l.GetData(), image...))
}

b.SetStatus(constants.StatusSuccess)
c.build = b

return nil
}

Expand All @@ -301,6 +297,9 @@ func (c *client) ExecBuild(ctx context.Context) error {
r := c.repo
e := c.err

b.SetStatus(constants.StatusSuccess)
c.build = b

defer func() {
// NOTE: When an error occurs during a build that does not have to do
// with a pipeline we should set build status to "error" not "failed"
Expand Down

0 comments on commit 701594f

Please sign in to comment.