mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-12-01 07:26:05 +07:00
capture version info after building
This commit is contained in:
@@ -56,9 +56,6 @@ func (b *BazelBuildBits) Build() error {
|
||||
// make sure we cd back when done
|
||||
defer os.Chdir(cwd)
|
||||
|
||||
// capture version info
|
||||
buildVersionFile(b.kubeRoot)
|
||||
|
||||
// build artifacts
|
||||
cmd := exec.Command("bazel", "build")
|
||||
cmd.Args = append(cmd.Args,
|
||||
@@ -73,7 +70,12 @@ func (b *BazelBuildBits) Build() error {
|
||||
)
|
||||
cmd.Debug = true
|
||||
cmd.InheritOutput = true
|
||||
return cmd.Run()
|
||||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// capture version info
|
||||
return buildVersionFile(b.kubeRoot)
|
||||
}
|
||||
|
||||
// Paths implements Bits.Paths
|
||||
|
||||
@@ -60,12 +60,6 @@ func (b *DockerBuildBits) Build() error {
|
||||
// make sure we cd back when done
|
||||
defer os.Chdir(cwd)
|
||||
|
||||
// capture version info
|
||||
err = buildVersionFile(b.kubeRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// the PR that added `make quick-release-images` added this script,
|
||||
// we can use it's presence to detect if that target exists
|
||||
// TODO(bentheelder): drop support for building without this once we've
|
||||
@@ -76,10 +70,18 @@ func (b *DockerBuildBits) Build() error {
|
||||
)
|
||||
// if we can't find the script, use the non `make quick-release-images` build
|
||||
if _, err := os.Stat(releaseImagesSH); err != nil {
|
||||
return b.buildBash()
|
||||
if err := b.buildBash(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
// otherwise leverage `make quick-release-images`
|
||||
if err := b.build(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// otherwise leverage `make quick-release-images`
|
||||
return b.build()
|
||||
|
||||
// capture version info
|
||||
return buildVersionFile(b.kubeRoot)
|
||||
}
|
||||
|
||||
// binary and image build when we have `make quick-release-images` support
|
||||
|
||||
Reference in New Issue
Block a user