mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Support building/packaging Windows client binaries.
Ug -- .exe suffix is a pain. These are largely untested.
This commit is contained in:
parent
e82b88fed8
commit
5bf43236e3
@ -489,11 +489,16 @@ function kube::release::package_client_tarballs() {
|
|||||||
rm -rf "${release_stage}"
|
rm -rf "${release_stage}"
|
||||||
mkdir -p "${release_stage}/client/bin"
|
mkdir -p "${release_stage}/client/bin"
|
||||||
|
|
||||||
# This fancy expression will expand to prepend a path
|
local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
|
||||||
# (${LOCAL_OUTPUT_BINPATH}/${platform}/) to every item in the
|
if [[ "${platform%/*}" == "windows" ]]; then
|
||||||
# KUBE_CLIENT_BINARIES array.
|
client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}")
|
||||||
cp "${KUBE_CLIENT_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
|
fi
|
||||||
"${release_stage}/client/bin/"
|
|
||||||
|
local bin
|
||||||
|
for bin in "${client_bins[@]}"; do
|
||||||
|
cp "${LOCAL_OUTPUT_BINPATH}/${platform}/${bin}" \
|
||||||
|
"${release_stage}/client/bin/"
|
||||||
|
done
|
||||||
|
|
||||||
local package_name="${RELEASE_DIR}/kubernetes-client-${platform_tag}.tar.gz"
|
local package_name="${RELEASE_DIR}/kubernetes-client-${platform_tag}.tar.gz"
|
||||||
kube::release::create_tarball "${package_name}" "${release_stage}/.."
|
kube::release::create_tarball "${package_name}" "${release_stage}/.."
|
||||||
@ -518,7 +523,11 @@ function kube::release::package_server_tarballs() {
|
|||||||
"${release_stage}/server/bin/"
|
"${release_stage}/server/bin/"
|
||||||
|
|
||||||
# Include the client binaries here too as they are useful debugging tools.
|
# Include the client binaries here too as they are useful debugging tools.
|
||||||
cp "${KUBE_CLIENT_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
|
local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
|
||||||
|
if [[ "${platform%/*}" == "windows" ]]; then
|
||||||
|
client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}")
|
||||||
|
fi
|
||||||
|
cp "${client_bins[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
|
||||||
"${release_stage}/server/bin/"
|
"${release_stage}/server/bin/"
|
||||||
|
|
||||||
local package_name="${RELEASE_DIR}/kubernetes-server-${platform_tag}.tar.gz"
|
local package_name="${RELEASE_DIR}/kubernetes-server-${platform_tag}.tar.gz"
|
||||||
@ -557,8 +566,12 @@ function kube::release::package_full_tarball() {
|
|||||||
# The server binaries are included with the server binary tarball.
|
# The server binaries are included with the server binary tarball.
|
||||||
local platform
|
local platform
|
||||||
for platform in "${KUBE_CLIENT_PLATFORMS[@]}"; do
|
for platform in "${KUBE_CLIENT_PLATFORMS[@]}"; do
|
||||||
|
local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
|
||||||
|
if [[ "${platform%/*}" == "windows" ]]; then
|
||||||
|
client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}")
|
||||||
|
fi
|
||||||
mkdir -p "${release_stage}/platforms/${platform}"
|
mkdir -p "${release_stage}/platforms/${platform}"
|
||||||
cp "${KUBE_CLIENT_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
|
cp "${client_bins[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
|
||||||
"${release_stage}/platforms/${platform}"
|
"${release_stage}/platforms/${platform}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ readonly KUBE_CLIENT_TARGETS=(
|
|||||||
cmd/kubernetes
|
cmd/kubernetes
|
||||||
)
|
)
|
||||||
readonly KUBE_CLIENT_BINARIES=("${KUBE_CLIENT_TARGETS[@]##*/}")
|
readonly KUBE_CLIENT_BINARIES=("${KUBE_CLIENT_TARGETS[@]##*/}")
|
||||||
|
readonly KUBE_CLIENT_BINARIES_WIN=("${KUBE_CLIENT_BINARIES[@]/%/.exe}")
|
||||||
|
|
||||||
# The set of test targets that we are building for all platforms
|
# The set of test targets that we are building for all platforms
|
||||||
readonly KUBE_TEST_TARGETS=(
|
readonly KUBE_TEST_TARGETS=(
|
||||||
@ -56,6 +57,7 @@ readonly KUBE_CLIENT_PLATFORMS=(
|
|||||||
linux/arm
|
linux/arm
|
||||||
darwin/amd64
|
darwin/amd64
|
||||||
darwin/386
|
darwin/386
|
||||||
|
windows/amd64
|
||||||
)
|
)
|
||||||
|
|
||||||
readonly KUBE_ALL_TARGETS=(
|
readonly KUBE_ALL_TARGETS=(
|
||||||
@ -280,6 +282,9 @@ kube::golang::build_binaries() {
|
|||||||
|
|
||||||
for binary in "${binaries[@]}"; do
|
for binary in "${binaries[@]}"; do
|
||||||
local bin=$(basename "${binary}")
|
local bin=$(basename "${binary}")
|
||||||
|
if [[ ${GOOS} == "windows" ]]; then
|
||||||
|
bin="${bin}.exe"
|
||||||
|
fi
|
||||||
go build -o "${output_path}/${bin}" \
|
go build -o "${output_path}/${bin}" \
|
||||||
"${goflags[@]:+${goflags[@]}}" \
|
"${goflags[@]:+${goflags[@]}}" \
|
||||||
-ldflags "${version_ldflags}" \
|
-ldflags "${version_ldflags}" \
|
||||||
|
Loading…
Reference in New Issue
Block a user