Skip to content

Commit

Permalink
Merge pull request kubernetes#16566 from jlowdermilk/automated-cherry…
Browse files Browse the repository at this point in the history
…-pick-of-#16287-kubernetes#16546-kubernetes#16565-upstream-release-1.1

Automated cherry pick of kubernetes#16287 kubernetes#16546 kubernetes#16565
  • Loading branch information
a-robinson committed Oct 30, 2015
2 parents 90bf6c2 + 69ed4be commit dc98871
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 4 deletions.
17 changes: 13 additions & 4 deletions hack/gen-swagger-doc/run-gen-swagger-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@ set -o errexit
set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
V1_PATH="$PWD/${KUBE_ROOT}/docs/api-reference/v1/"
V1BETA1_PATH="$PWD/${KUBE_ROOT}/docs/api-reference/extensions/v1beta1"
SWAGGER_PATH="$PWD/${KUBE_ROOT}/api/swagger-spec/"
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
REPO_DIR=${REPO_DIR:-"${PWD}/${KUBE_ROOT}"}
DEFAULT_OUTPUT_PATH="${REPO_DIR}/docs/api-reference"
OUTPUT=${1:-${DEFAULT_OUTPUT_PATH}}

echo "Generating api reference docs at ${OUTPUT}"

V1_PATH="${OUTPUT}/v1/"
V1BETA1_PATH="${OUTPUT}/extensions/v1beta1"
SWAGGER_PATH="${REPO_DIR}/api/swagger-spec/"

echo "Reading swagger spec from: ${SWAGGER_PATH}"

mkdir -p $V1_PATH
mkdir -p $V1BETA1_PATH

Expand Down
46 changes: 46 additions & 0 deletions hack/jenkins/gotest-dockerized.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

export REPO_DIR=${REPO_DIR:-$(pwd)}

# Produce a JUnit-style XML test report for Jenkins.
export KUBE_JUNIT_REPORT_DIR=${WORKSPACE}/_artifacts

# Run the kubekins container, mapping in docker (so we can launch containers),
# the repo directory, and the artifacts output directory.
#
# Note: We pass in the absolute path to the repo on the host as an env var incase
# any tests that get run need to launch containers that also map volumes.
# This is required because if you do
#
# $ docker run -v $PATH:/container/path ...
#
# From _inside_ a container that has the host's docker mapped in, the $PATH
# provided must be resolvable on the *HOST*, not the container.

docker run --rm=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(which docker)":/bin/docker \
-v "${REPO_DIR}":/go/src/k8s.io/kubernetes \
-v "${KUBE_JUNIT_REPORT_DIR}":/workspace/artifacts \
--env REPO_DIR="${REPO_DIR}" \
-i gcr.io/google_containers/kubekins-test:0.2 \
bash -c "cd kubernetes && ./hack/jenkins/test-dockerized.sh"
57 changes: 57 additions & 0 deletions hack/jenkins/test-dockerized.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

# Runs the unit and integration tests, producing JUnit-style XML test
# reports in ${WORKSPACE}/artifacts. This script is intended to be run from
# kubekins-test container with a kubernetes repo mapped in. See
# hack/jenkins/gotest-dockerized.sh

export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}

go get github.com/tools/godep
go get github.com/jstemmer/go-junit-report

# Enable the Go race detector.
export KUBE_RACE=-race
# Disable coverage report
export KUBE_COVER="n"
# Produce a JUnit-style XML test report for Jenkins.
export KUBE_JUNIT_REPORT_DIR=${WORKSPACE}/artifacts
# Save the verbose stdout as well.
export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y
export KUBE_TIMEOUT='-timeout 300s'
export KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=4
export LOG_LEVEL=4
export KUBE_TEST_API_VERSIONS=v1,extensions/v1beta1
export KUBE_TEST_ETCD_PREFIXES=registry

./hack/build-go.sh
godep go install ./...
./hack/travis/install-etcd.sh

./hack/verify-all.sh -v

./hack/test-go.sh -- -p=2
./hack/test-cmd.sh
./hack/test-integration.sh
./hack/test-update-storage-objects.sh


31 changes: 31 additions & 0 deletions hack/jenkins/test-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file creates a build environment for building and running kubernetes
# unit and integration tests

FROM golang:1.4
MAINTAINER Jeff Lowdermilk <jeffml@google.com>

ENV WORKSPACE /workspace
ENV TERM xterm

WORKDIR /workspace

RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y rsync
RUN apt-get install -y file
RUN mkdir -p /go/src/k8s.io/kubernetes
RUN ln -s /go/src/k8s.io/kubernetes /workspace/kubernetes

RUN /bin/bash
13 changes: 13 additions & 0 deletions hack/jenkins/test-image/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
all: push

TAG = 0.2

container:
docker build -t gcr.io/google_containers/kubekins-test .
docker tag gcr.io/google_containers/kubekins-test gcr.io/google_containers/kubekins-test:$(TAG)

push: container
gcloud docker push gcr.io/google_containers/kubekins-test # Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/kubekins-test:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)

clean:

0 comments on commit dc98871

Please sign in to comment.