Add kubectl to build/release scripts.

Also Refactor build helpers into client/cross and server/linux.  This make it easier to tell users what to build to get just the client binaries.
This commit is contained in:
Joe Beda
2014-10-15 16:50:17 -07:00
parent f61d434783
commit 3701c2ac0e
9 changed files with 43 additions and 29 deletions

View File

@@ -23,6 +23,19 @@ cd "${KUBE_ROOT}"
readonly KUBE_TARGET="${KUBE_ROOT}/_output/build"
readonly KUBE_GO_PACKAGE=github.com/GoogleCloudPlatform/kubernetes
server_targets=(
cmd/proxy
cmd/apiserver
cmd/controller-manager
cmd/kubelet
plugin/cmd/scheduler
)
client_targets=(
cmd/kubecfg
cmd/kubectl
)
mkdir -p "${KUBE_TARGET}"
if [[ ! -f "/kube-build-image" ]]; then
@@ -46,19 +59,11 @@ function kube::build::make_binary() {
}
function kube::build::make_binaries() {
local -a targets=(
cmd/proxy
cmd/apiserver
cmd/controller-manager
cmd/kubelet
cmd/kubecfg
plugin/cmd/scheduler
)
if [[ -n "${1-}" ]]; then
targets=("$1")
fi
[[ $# -gt 0 ]] || {
echo "!!! Internal error. kube::build::make_binaries called with no targets."
}
local -a targets=("$@")
local -a binaries=()
local target
for target in "${targets[@]}"; do

View File

@@ -21,16 +21,19 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
readonly CROSS_BINARIES=(
./cmd/kubecfg
)
platforms=(linux/amd64 $KUBE_CROSSPLATFORMS)
targets=("${client_targets[@]}")
for platform in ${KUBE_CROSSPLATFORMS}; do
if [[ $# -gt 0 ]]; then
targets=("$@")
fi
for platform in "${platforms[@]}"; do
(
# Subshell to contain these exports
export GOOS=${platform%/*}
export GOARCH=${platform##*/}
for binary in "${CROSS_BINARIES[@]}"; do
kube::build::make_binaries "${binary}"
done
kube::build::make_binaries "${targets[@]}"
)
done

View File

@@ -21,4 +21,9 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
kube::build::make_binaries "$@"
targets=("${server_targets[@]}")
if [[ $# -gt 0 ]]; then
targets=("$@")
fi
kube::build::make_binaries "${targets[@]}"