Merge pull request #1748 from jbeda/make-cross-copy

Smooth over some build rough edges
This commit is contained in:
Brendan Burns 2014-10-13 15:44:07 -07:00
commit a3ff95d6ed
5 changed files with 19 additions and 10 deletions

View File

@ -64,6 +64,7 @@ test_e2e:
# Example:
# make clean
clean:
build/make-clean.sh
rm -rf $(OUT_DIR)
rm -rf $(GODEPS_PKG_DIR)
.PHONY: clean
@ -87,7 +88,7 @@ vet:
# Build a release
#
# Example:
# make clean
# make release
release:
build/release.sh
.PHONY: release

View File

@ -56,6 +56,7 @@ readonly KUBE_GO_PACKAGE="github.com/GoogleCloudPlatform/kubernetes"
# this is still inside the VM. We use the same directory in both cases though.
readonly LOCAL_OUTPUT_ROOT="${KUBE_ROOT}/_output"
readonly LOCAL_OUTPUT_BUILD="${LOCAL_OUTPUT_ROOT}/build"
readonly LOCAL_OUTPUT_IMAGE_STAGING="${LOCAL_OUTPUT_ROOT}/images"
readonly REMOTE_OUTPUT_ROOT="/go/src/${KUBE_GO_PACKAGE}/_output"
readonly REMOTE_OUTPUT_DIR="${REMOTE_OUTPUT_ROOT}/build"
readonly DOCKER_MOUNT_ARGS=(--volume "${LOCAL_OUTPUT_BUILD}:${REMOTE_OUTPUT_DIR}")
@ -150,7 +151,7 @@ function kube::build::is_osx() {
function kube::build::clean_output() {
# Clean out the output directory if it exists.
if kube::build::build_image_built ; then
echo "+++ Cleaning out _output/ via docker build image"
echo "+++ Cleaning out _output/build via docker build image"
kube::build::run_build_command bash -c "rm -rf '${REMOTE_OUTPUT_DIR}'/*"
else
echo "!!! Build image not built. Cannot clean via docker build image."
@ -237,7 +238,7 @@ function kube::build::ensure_golang_cross() {
# Set up the context directory for the kube-build image and build it.
function kube::build::build_image() {
local -r build_context_dir="${LOCAL_OUTPUT_ROOT}/images/${KUBE_BUILD_IMAGE}"
local -r build_context_dir="${LOCAL_OUTPUT_IMAGE_STAGING}/${KUBE_BUILD_IMAGE}"
local -r source=(
api
build
@ -269,7 +270,7 @@ EOF
function kube::build::run_image() {
[[ ${KUBE_BUILD_RUN_IMAGES} =~ ^[yY]$ ]] || return 0
local -r build_context_base="${LOCAL_OUTPUT_ROOT}/images/${KUBE_RUN_IMAGE_BASE}"
local -r build_context_base="${LOCAL_OUTPUT_IMAGE_STAGING}/${KUBE_RUN_IMAGE_BASE}"
# First build the base image. This one brings in all of the binaries.
mkdir -p "${build_context_base}"

View File

@ -28,3 +28,4 @@ source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image
kube::build::run_build_command build/build-image/make-binaries.sh "$@"
kube::build::copy_output

View File

@ -29,3 +29,4 @@ source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image
kube::build::run_build_command build/build-image/make-cross.sh
kube::build::copy_output

View File

@ -62,13 +62,18 @@ kubecfg="${KUBE_ROOT}/_output/build/${host_os}/${host_arch}/kubecfg"
if [[ ! -x "$kubecfg" ]]; then
kubecfg="${KUBE_ROOT}/platforms/${host_os}/${host_arch}/kubecfg"
fi
if [[ ! -x "$kubecfg" ]]; then
echo "It looks as if you don't have a compiled version of Kubernetes. If you" >&2
echo "are running from a clone of the git repo, please run ./build/make-cross.sh." >&2
echo "Note that this requires having Docker installed. If you are running " >&2
echo "from a release tarball, something is wrong. Look at " >&2
echo "http://kubernetes.io/ for information on how to contact the "
echo "development team for help." >&2
{
echo "It looks as if you don't have a compiled kubecfg binary."
echo
echo "If you are running from a clone of the git repo, please run"
echo "'./build/make-cross.sh'. Note that this requires having Docker installed."
echo
echo "If you are running from a binary release tarball, something is wrong. "
echo "Look at http://kubernetes.io/ for information on how to contact the "
echo "development team for help."
} >&2
exit 1
fi