Skip to content

Commit

Permalink
Merge pull request #20958 from openshift-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-20935-to-release-3.11

[release-3.11] hack: copy oc to kubectl
  • Loading branch information
eparis authored Sep 12, 2018
2 parents 5a04ef7 + 0851007 commit d545994
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions hack/build-cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ if [[ "${OS_BUILD_RELEASE_ARCHIVES-}" != "n" ]]; then
os::build::release_sha
else
# Place binaries only
OS_BUILD_PLATFORMS=("${platforms[@]+"${platforms[@]}"}") \
os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}"
OS_BUILD_PLATFORMS=("${image_platforms[@]+"${image_platforms[@]}"}") \
os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}"
OS_BUILD_PLATFORMS=("${platforms[@]+"${platforms[@]}"}")
os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}"
OS_BUILD_PLATFORMS=("${image_platforms[@]+"${image_platforms[@]}"}")
os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}"
fi

if [[ "${OS_GIT_TREE_STATE:-dirty}" == "clean" ]]; then
Expand Down
18 changes: 13 additions & 5 deletions hack/lib/build/binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,18 @@ function os::build::place_bins() {
fi
done

# Link binaries that we want to link (eg. oc->kubectl)
local suffix=""
if [[ $platform == "windows/amd64" ]]; then
suffix=".exe"
fi
for linkname in "${OC_BINARY_COPY[@]}"; do
local src="${OS_OUTPUT_BINPATH}/${platform}/oc${suffix}"
if [[ -f "${src}" ]]; then
ln -f "$src" "${OS_OUTPUT_BINPATH}/${platform}/${linkname}${suffix}"
fi
done

# If no release archive was requested, we're done.
if [[ "${OS_RELEASE_ARCHIVE-}" == "" ]]; then
continue
Expand All @@ -342,14 +354,10 @@ function os::build::place_bins() {
done

# Create binary copies where specified.
local suffix=""
if [[ $platform == "windows/amd64" ]]; then
suffix=".exe"
fi
for linkname in "${OC_BINARY_COPY[@]}"; do
local src="${release_binpath}/oc${suffix}"
if [[ -f "${src}" ]]; then
ln "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}"
cp -f "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}"
fi
done

Expand Down

0 comments on commit d545994

Please sign in to comment.