From e637429d8e2945fffe6079df13c06555c4d48fb1 Mon Sep 17 00:00:00 2001 From: Stephen Augustus Date: Wed, 27 May 2020 02:43:21 -0400 Subject: [PATCH] push-build: look for version in bazel-bin 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 --- push-build.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/push-build.sh b/push-build.sh index 9f4ae3403de..7e85c08ed21 100755 --- a/push-build.sh +++ b/push-build.sh @@ -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