diff --git a/Makefile b/Makefile index 60e80f0c911..4c374ba342a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build/common.sh b/build/common.sh index 75495bb8a5b..0c1e5e328c5 100644 --- a/build/common.sh +++ b/build/common.sh @@ -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}" diff --git a/build/make-binaries.sh b/build/make-binaries.sh index 7402228877e..7df9d121649 100755 --- a/build/make-binaries.sh +++ b/build/make-binaries.sh @@ -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 diff --git a/build/make-cross.sh b/build/make-cross.sh index a739af83b9a..730df7521fa 100755 --- a/build/make-cross.sh +++ b/build/make-cross.sh @@ -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 diff --git a/cluster/kubecfg.sh b/cluster/kubecfg.sh index c4013df925e..aed47ae0341 100755 --- a/cluster/kubecfg.sh +++ b/cluster/kubecfg.sh @@ -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