Skip to content

Commit

Permalink
push-build: look for version in bazel-bin
Browse files Browse the repository at this point in the history
bazel-bin and bazel-genfiles have pointed to the same location since
0.25. -genfiles is deprecated.

ref: bazelbuild/bazel#8651

Signed-off-by: Stephen Augustus <saugustus@vmware.com>
  • Loading branch information
justaugustus committed May 27, 2020
1 parent 61f9d7d commit e637429
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions push-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,18 @@ RELEASE_BUCKET=${FLAGS_bucket:-"kubernetes-release-dev"}
# This will canonicalize the path
KUBE_ROOT=$(pwd -P)

# TODO: this should really just read the version from the release tarball always
USE_BAZEL=false
if release::was_built_with_bazel $KUBE_ROOT $FLAGS_release_kind; then
USE_BAZEL=true
bazel build //:version
LATEST=$(cat $KUBE_ROOT/bazel-genfiles/version)
# The check for version in bazel-genfiles can be removed once everyone is off
# of versions before 0.25.0.
# https://github.com/bazelbuild/bazel/issues/8651
if [[ -r "$KUBE_ROOT/bazel-genfiles/version" ]]; then
LATEST=$(cat $KUBE_ROOT/bazel-genfiles/version)
else
LATEST=$(cat $KUBE_ROOT/bazel-bin/version)
fi
else
LATEST=$(tar -O -xzf $KUBE_ROOT/_output/release-tars/$FLAGS_release_kind.tar.gz $FLAGS_release_kind/version)
fi
Expand Down

0 comments on commit e637429

Please sign in to comment.