Skip to content

Commit

Permalink
Add option to copy output when running the build shell
Browse files Browse the repository at this point in the history
  • Loading branch information
cblecker committed Aug 25, 2017
1 parent 68232c3 commit 4d63e13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 10 additions & 1 deletion build/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions build/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"

0 comments on commit 4d63e13

Please sign in to comment.