From 76baaa15b2c5dd11c712a7288574ebf9f8ba59a4 Mon Sep 17 00:00:00 2001 From: Joe Beda Date: Thu, 14 Aug 2014 16:28:47 -0700 Subject: [PATCH] Fix up not-yet-ready build/... stuff for godep --- build/build-image/Dockerfile | 6 +++--- build/build-image/common.sh | 2 +- build/build-image/run-tests.sh | 20 ++------------------ build/common.sh | 11 +++++++---- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index c5148331ad2..87e7cb16bbd 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -45,17 +45,17 @@ RUN cd /usr/local/go/src && \ # Set up Go Environment ENV PATH /go/bin:$PATH -ENV GOPATH /go:/go/src/github.com/GoogleCloudPlatform/kubernetes/third_party +ENV GOPATH /go ENV GOOS linux ENV GOARCH amd64 # Get the code coverage tool and etcd for integration tests -RUN go get code.google.com/p/go.tools/cmd/cover github.com/coreos/etcd +RUN go get code.google.com/p/go.tools/cmd/cover github.com/coreos/etcd github.com/tools/godep # Mark this as a kube-build container RUN touch /kube-build-image WORKDIR /go/src/github.com/GoogleCloudPlatform/kubernetes -# Upload Kubernetes +# Upload Kubernetes source ADD kube-source.tar.gz /go/src/github.com/GoogleCloudPlatform/kubernetes diff --git a/build/build-image/common.sh b/build/build-image/common.sh index d876dfd900a..6a6a28a22ba 100644 --- a/build/build-image/common.sh +++ b/build/build-image/common.sh @@ -42,7 +42,7 @@ function make-binaries() { function make-binary() { echo "+++ Building $1 for ${GOOS}/${GOARCH}" - go build \ + godep go build \ -o "${ARCH_TARGET}/$1" \ github.com/GoogleCloudPlatform/kubernetes/cmd/$1 } diff --git a/build/build-image/run-tests.sh b/build/build-image/run-tests.sh index 5f1ee1a60eb..b6eb869f88a 100755 --- a/build/build-image/run-tests.sh +++ b/build/build-image/run-tests.sh @@ -19,27 +19,11 @@ set -e source $(dirname $0)/common.sh -find_test_dirs() { - ( - cd ${KUBE_REPO_ROOT} - find . -not \( \ - \( \ - -wholename './third_party' \ - -o -wholename './output' \ - \) -prune \ - \) -name '*_test.go' -print0 | xargs -0n1 dirname | sort -u - ) -} - -cd "${KUBE_TARGET}" - echo "+++ Running unit tests" if [[ -n "$1" ]]; then - go test -cover -coverprofile=tmp.out "$KUBE_GO_PACKAGE/$1" + godep go test -cover -coverprofile=tmp.out "$KUBE_GO_PACKAGE/$1" exit 0 fi -for package in $(find_test_dirs); do - go test -cover -coverprofile=tmp.out "${KUBE_GO_PACKAGE}/${package}" -done +godep go test ./... diff --git a/build/common.sh b/build/common.sh index 42707cca955..409573155ec 100644 --- a/build/common.sh +++ b/build/common.sh @@ -121,10 +121,13 @@ function build-image() { api build cmd + examples + Godeps hack + LICENSE + README.md pkg third_party - LICENSE " mkdir -p ${BUILD_CONTEXT_DIR} tar czf ${BUILD_CONTEXT_DIR}/kube-source.tar.gz ${SOURCE} @@ -194,9 +197,9 @@ function run-build-command() { # If the Docker server is remote, copy the results back out. function copy-output() { if [[ "$OSTYPE" == "darwin"* ]]; then - # When we are on the Mac with boot2docker Now we need to copy the results - # back out. Ideally we would leave the container around and use 'docker cp' - # to copy the results out. However, that doesn't work for mounted volumes + # When we are on the Mac with boot2docker we need to copy the results back + # out. Ideally we would leave the container around and use 'docker cp' to + # copy the results out. However, that doesn't work for mounted volumes # currently (https://github.com/dotcloud/docker/issues/1992). And it is # just plain broken (https://github.com/dotcloud/docker/issues/6483). #