Update scripts to look for binary artifacts in bazel-bin/

This commit is contained in:
Jeff Grafton
2017-01-13 14:49:38 -08:00
parent bc4b6ac397
commit b9e060a630
4 changed files with 37 additions and 26 deletions

View File

@@ -167,12 +167,19 @@ kube::util::host_platform() {
kube::util::find-binary-for-platform() {
local -r lookfor="$1"
local -r platform="$2"
local -r locations=(
local locations=(
"${KUBE_ROOT}/_output/bin/${lookfor}"
"${KUBE_ROOT}/_output/dockerized/bin/${platform}/${lookfor}"
"${KUBE_ROOT}/_output/local/bin/${platform}/${lookfor}"
"${KUBE_ROOT}/platforms/${platform}/${lookfor}"
)
# Also search for binary in bazel build tree.
# In some cases we have to name the binary $BINARY_bin, since there was a
# directory named $BINARY next to it.
locations+=($(find "${KUBE_ROOT}/bazel-bin/" -type f -executable \
\( -name "${lookfor}" -o -name "${lookfor}_bin" \) 2>/dev/null || true) )
# List most recently-updated location.
local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
echo -n "${bin}"
}