Commit 6dd73e56
6dd73e563575Merged
Vigilans <[email protected]> ยท 2 years ago ยท 2 files ยท ~2 modified
Description
Refine per-release build hook point
- per-release pre-build should be run after p.buildReleases(o.Tags, o.MatchAll) (so as soon as we know list of releases, we run the hook)
- per-release post-build should be run in the end of *Plan.Build (after everything was built)
Details
- Commit
- 6dd73e563575
- Parent
- 0fe60d565ba5
pkg/plan/build.gomodifiedView file
@@ -34,11 +34,23 @@
3434
}3535
3636
defer func() {37-
lifecycleErr := p.body.Lifecycle.RunPostBuild(ctx)38-
if lifecycleErr != nil {39-
log.Errorf("got an error from postbuild hooks: %v", lifecycleErr)37+
lifeCycleErr := p.body.Lifecycle.RunPostBuild(ctx)38+
if lifeCycleErr != nil {39+
log.Errorf("got an error from postbuild hooks: %v", lifeCycleErr)4040
if err == nil {41-
err = lifecycleErr41+
err = lifeCycleErr42+
}43+
return44+
}45+
for _, r := range p.body.Releases {46+
lifeCycle := r.LifeCycle()47+
lifeCycleErr = lifeCycle.RunPostBuild(ctx)48+
if lifeCycleErr != nil {49+
log.Errorf("got an error from postbuild hooks for release %s: %v", r.Name(), lifeCycleErr)50+
if err == nil {51+
err = lifeCycleErr52+
}53+
return4254
}4355
}4456
}()pkg/plan/build_releases.gomodifiedView file
Loading diffโฆ