From 4d63e13c9fedd75e352e09102497a768f79da225 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Fri, 25 Aug 2017 16:58:06 -0700 Subject: [PATCH] Add option to copy output when running the build shell --- build/run.sh | 11 ++++++++++- build/shell.sh | 5 +---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build/run.sh b/build/run.sh index af6e92dfa3f..5304f928037 100755 --- a/build/run.sh +++ b/build/run.sh @@ -25,10 +25,19 @@ set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "$KUBE_ROOT/build/common.sh" +KUBE_RUN_COPY_OUTPUT="${KUBE_RUN_COPY_OUTPUT:-y}" + kube::build::verify_prereqs kube::build::build_image + +if [[ ${KUBE_RUN_COPY_OUTPUT} =~ ^[yY]$ ]]; then + kube::log::status "Output from this container will be rsynced out upon completion. Set KUBE_RUN_COPY_OUTPUT=n to disable." +else + kube::log::status "Output from this container will NOT be rsynced out upon completion. Set KUBE_RUN_COPY_OUTPUT=y to enable." +fi + kube::build::run_build_command "$@" -if [[ ${KUBE_RUN_COPY_OUTPUT:-y} =~ ^[yY]$ ]]; then +if [[ ${KUBE_RUN_COPY_OUTPUT} =~ ^[yY]$ ]]; then kube::build::copy_output fi diff --git a/build/shell.sh b/build/shell.sh index 6f546b662de..dac2e494976 100755 --- a/build/shell.sh +++ b/build/shell.sh @@ -24,8 +24,5 @@ set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/build/common.sh" -source "${KUBE_ROOT}/build/lib/release.sh" -kube::build::verify_prereqs -kube::build::build_image -kube::build::run_build_command bash || true +KUBE_RUN_COPY_OUTPUT="${KUBE_RUN_COPY_OUTPUT:-n}" "${KUBE_ROOT}/build/run.sh" bash "$@"