Standardize how we refer to the kubernetes root.

Now use $KUBE_ROOT as the variable pretty much everywhere.
This commit is contained in:
Joe Beda
2014-10-03 14:58:49 -07:00
parent 38d5906044
commit d43a6ec5a3
42 changed files with 172 additions and 156 deletions

View File

@@ -17,9 +17,10 @@
# This script sets up a go workspace locally and builds all go components.
# You can 'source' this file if you want to set up GOPATH in your local shell.
cd $(dirname "${BASH_SOURCE}")/../.. >/dev/null
readonly KUBE_REPO_ROOT="${PWD}"
readonly KUBE_TARGET="${KUBE_REPO_ROOT}/_output/build"
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
cd "${KUBE_ROOT}"
readonly KUBE_TARGET="${KUBE_ROOT}/_output/build"
readonly KUBE_GO_PACKAGE=github.com/GoogleCloudPlatform/kubernetes
mkdir -p "${KUBE_TARGET}"
@@ -39,7 +40,7 @@ function kube::build::make_binary() {
local -r bin=${gopkg##*/}
echo "+++ Building ${bin} for ${GOOS}/${GOARCH}"
pushd "${KUBE_REPO_ROOT}" >/dev/null
pushd "${KUBE_ROOT}" >/dev/null
godep go build -ldflags "${KUBE_LD_FLAGS-}" -o "${ARCH_TARGET}/${bin}" "${gopkg}"
popd >/dev/null
}

View File

@@ -16,6 +16,7 @@
set -e
source $(dirname $0)/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
kube::build::make_binaries "$@"

View File

@@ -16,7 +16,8 @@
set -e
source $(dirname $0)/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
readonly CROSS_BINARIES=(
./cmd/kubecfg

View File

@@ -16,20 +16,21 @@
set -e
source $(dirname $0)/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
kube::build::make_binaries "./cmd/integration"
readonly ETCD_DIR="${KUBE_REPO_ROOT}/_output/etcd"
readonly ETCD_DIR="${KUBE_ROOT}/_output/etcd"
mkdir -p "${ETCD_DIR}"
echo "+++ Running integration test"
etcd -name test -data-dir ${ETCD_DIR} > "${KUBE_REPO_ROOT}/_output/etcd.log" &
etcd -name test -data-dir ${ETCD_DIR} > "${KUBE_ROOT}/_output/etcd.log" &
readonly ETCD_PID=$!
sleep 5
${KUBE_TARGET}/linux/amd64/integration
"${KUBE_TARGET}/linux/amd64/integration"
kill $ETCD_PID

View File

@@ -16,7 +16,8 @@
set -e
source $(dirname $0)/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
echo "+++ Running unit tests"

View File

@@ -19,7 +19,8 @@ set -o errexit
set -o nounset
set -o pipefail
cd $(dirname "${BASH_SOURCE}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${KUBE_ROOT}"
source hack/config-go.sh
@@ -36,8 +37,6 @@ readonly KUBE_GCS_MAKE_PUBLIC="${KUBE_GCS_MAKE_PUBLIC:-y}"
# Constants
readonly KUBE_REPO_ROOT="${PWD}"
readonly KUBE_BUILD_IMAGE_REPO=kube-build
readonly KUBE_BUILD_IMAGE_TAG=build
readonly KUBE_BUILD_IMAGE="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_TAG}"
@@ -49,7 +48,7 @@ readonly KUBE_GO_PACKAGE="github.com/GoogleCloudPlatform/kubernetes"
#
# Note that here "LOCAL" is local to the docker daemon. In the boot2docker case
# this is still inside the VM. We use the same directory in both cases though.
readonly LOCAL_OUTPUT_ROOT="${KUBE_REPO_ROOT}/_output"
readonly LOCAL_OUTPUT_ROOT="${KUBE_ROOT}/_output"
readonly LOCAL_OUTPUT_BUILD="${LOCAL_OUTPUT_ROOT}/build"
readonly REMOTE_OUTPUT_ROOT="/go/src/${KUBE_GO_PACKAGE}/_output"
readonly REMOTE_OUTPUT_DIR="${REMOTE_OUTPUT_ROOT}/build"
@@ -374,7 +373,7 @@ function kube::release::package_salt_tarball() {
rm -rf "${release_stage}"
mkdir -p "${release_stage}"
cp -R "${KUBE_REPO_ROOT}/cluster/saltbase" "${release_stage}/"
cp -R "${KUBE_ROOT}/cluster/saltbase" "${release_stage}/"
local package_name="${RELEASE_DIR}/kubernetes-salt.tar.gz"
tar czf "${package_name}" -C "${release_stage}/.." .
@@ -396,7 +395,7 @@ function kube::release::package_full_tarball() {
# We want everything in /cluster except saltbase. That is only needed on the
# server.
cp -R "${KUBE_REPO_ROOT}/cluster" "${release_stage}/"
cp -R "${KUBE_ROOT}/cluster" "${release_stage}/"
rm -rf "${release_stage}/cluster/saltbase"
mkdir -p "${release_stage}/server"
@@ -404,12 +403,12 @@ function kube::release::package_full_tarball() {
cp "${RELEASE_DIR}"/kubernetes-server-*.tar.gz "${release_stage}/server/"
mkdir -p "${release_stage}/third_party"
cp -R "${KUBE_REPO_ROOT}/third_party/htpasswd" "${release_stage}/third_party/htpasswd"
cp -R "${KUBE_ROOT}/third_party/htpasswd" "${release_stage}/third_party/htpasswd"
cp -R "${KUBE_REPO_ROOT}/examples" "${release_stage}/"
cp "${KUBE_REPO_ROOT}/README.md" "${release_stage}/"
cp "${KUBE_REPO_ROOT}/LICENSE" "${release_stage}/"
cp "${KUBE_REPO_ROOT}/Vagrantfile" "${release_stage}/"
cp -R "${KUBE_ROOT}/examples" "${release_stage}/"
cp "${KUBE_ROOT}/README.md" "${release_stage}/"
cp "${KUBE_ROOT}/LICENSE" "${release_stage}/"
cp "${KUBE_ROOT}/Vagrantfile" "${release_stage}/"
local package_name="${RELEASE_DIR}/kubernetes.tar.gz"
tar czf "${package_name}" -C "${release_stage}/.." .

View File

@@ -19,7 +19,8 @@
# This is a no-op on Linux when the Docker daemon is local. This is only
# necessary on Mac OS X with boot2docker.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::copy_output

View File

@@ -19,7 +19,8 @@
# This makes the docker build image, builds the binaries and copies them out
# of the docker container.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -21,7 +21,8 @@
# directory. It will then copy over the Dockerfile and build the kube-build
# image.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT="$(dirname "${BASH_SOURCE}")/.."
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -16,7 +16,8 @@
# Clean out the output directory on the docker host.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::clean_output

View File

@@ -19,7 +19,8 @@
# This makes the docker build image, builds the cross binaries and copies them
# out of the docker container.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -19,7 +19,8 @@
# This script will make the 'run image' after building all of the necessary
# binaries.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -18,7 +18,8 @@
# images and other build artifacts. All intermediate artifacts will be hosted
# publicly on Google Cloud Storage currently.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -16,7 +16,8 @@
# Run the integration test.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -16,7 +16,8 @@
# Run all of the golang unit tests.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image

View File

@@ -18,7 +18,8 @@
#
# This container will have a snapshot of the current sources.
source $(dirname "${BASH_SOURCE}")/common.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
kube::build::verify_prereqs
kube::build::build_image