Document public KUBE_* environment variables and export them

Add a section for environment variables in config-go.sh. Document the
three public environment variables defined by this script. Make sure the
variables get exported so that they can be used by commands spawned by a
shell that sourced the config script.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
Filipe Brandenburger 2014-08-27 20:35:27 -07:00
parent dcf9f30592
commit 09dd081543

View File

@ -97,6 +97,12 @@ kube::setup_go_environment() {
}
# --- Environment Variables ---
# KUBE_REPO_ROOT - Path to the top of the build tree.
# KUBE_TARGET - Path where output Go files are saved.
# KUBE_GO_PACKAGE - Full name of the Kubernetes Go package.
KUBE_REPO_ROOT=$(dirname "${BASH_SOURCE:-$0}")/..
if [[ "${OSTYPE:-}" == *darwin* ]]; then
# Make the path absolute if it is not.
@ -107,11 +113,15 @@ else
# Resolve symlinks.
KUBE_REPO_ROOT=$(readlink -f "${KUBE_REPO_ROOT}")
fi
export KUBE_REPO_ROOT
KUBE_TARGET="${KUBE_REPO_ROOT}/output/go"
mkdir -p "${KUBE_TARGET}"
export KUBE_TARGET
KUBE_GO_PACKAGE=github.com/GoogleCloudPlatform/kubernetes
export KUBE_GO_PACKAGE
KUBE_GO_PACKAGE_DIR="${KUBE_TARGET}/src/${KUBE_GO_PACKAGE}"
KUBE_GO_PACKAGE_BASEDIR=$(dirname "${KUBE_GO_PACKAGE_DIR}")