Hook 'build/make-clean.sh' into 'make clean' in Makefile

pull/6/head
Joe Beda 2014-10-11 07:34:22 -07:00
parent b2395c76f2
commit 5df3f54204
2 changed files with 6 additions and 4 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}"