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

This commit is contained in:
Sidharta Seethana 2015-02-20 15:55:39 -08:00
parent 5ea0895987
commit aea11720fd

View File

@ -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}"
@ -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
@ -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")