Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting boot2docker env variables for release and clean targets when boot2docker is running #4684

Merged
merged 1 commit into from
Feb 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set -o pipefail
DOCKER_OPTS=${DOCKER_OPTS:-""}
DOCKER_NATIVE=${DOCKER_NATIVE:-""}
DOCKER=(docker ${DOCKER_OPTS})
DOCKER_HOST=${DOCKER_HOST:-""}

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${KUBE_ROOT}"
Expand Down Expand Up @@ -131,6 +132,10 @@ function kube::build::verify_prereqs() {
# Reach over and set the clock. After sleep/resume the clock will skew.
echo "+++ Setting boot2docker clock"
boot2docker ssh sudo date -u -D "%Y%m%d%H%M.%S" --set "$(date -u +%Y%m%d%H%M.%S)" >/dev/null
if [[ -z "$DOCKER_HOST" ]]; then
echo "+++ Setting boot2docker env variables"
$(boot2docker shellinit)
fi
fi
fi
fi
Expand All @@ -150,6 +155,20 @@ function kube::build::verify_prereqs() {
} >&2
exit 1
fi
else

# On OS X, set boot2docker env vars for the 'clean' target if boot2docker is running
if kube::build::is_osx && kube::build::has_docker ; then
if [[ ! -z "$(which boot2docker)" ]]; then
if [[ $(boot2docker status) == "running" ]]; then
if [[ -z "$DOCKER_HOST" ]]; then
echo "+++ Setting boot2docker env variables"
$(boot2docker shellinit)
fi
fi
fi
fi

fi

KUBE_ROOT_HASH=$(kube::build::short_hash "$KUBE_ROOT")
Expand Down