Skip to content

Instantly share code, notes, and snippets.

@hh
Forked from ethernetdan/build-kube-e2e.sh
Last active April 12, 2018 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hh/6c3fd97e32f3c4e135d5a73c1d29dfc4 to your computer and use it in GitHub Desktop.
Save hh/6c3fd97e32f3c4e135d5a73c1d29dfc4 to your computer and use it in GitHub Desktop.
Build Docker image of Kubernetes E2E tests
#!/bin/bash -x
set -euo pipefail
echo "Building conformance image..."
echo
APT_PACKAGES="rsync"
# build docker image of repository
docker build -t "${IMAGE_NAME}:${IMAGE_TAG}" - <<EOF
FROM golang:1.8
# install conformance dependencies
RUN apt-get update && apt-get install -y ${APT_PACKAGES} && rm -rf /var/lib/apt/lists/*
# clone conformance repository
RUN mkdir -p \${GOPATH}/src/k8s.io && git clone --branch ${CONFORMANCE_TAG} --depth 1 https://${CONFORMANCE_REPO} \${GOPATH}/src/k8s.io/kubernetes
WORKDIR \${GOPATH}/src/k8s.io/kubernetes
# install build dependencies
RUN go get -u github.com/jteeuwen/go-bindata/go-bindata
# build all test dependencies
RUN GOLDFLAGS="--s -w" make all WHAT="cmd/kubectl vendor/github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test"
ENV TEST_FLAGS="-v --test --check-version-skew=false --test_args=--ginkgo.focus=\[Conformance\]"
CMD HOME=/go/src/k8s.io/kubernetes KUBECONFIG=/kubeconfig KUBE_OS_DISTRIBUTION=coreos KUBERNETES_CONFORMANCE_TEST=Y go run hack/e2e.go -- \${TEST_FLAGS}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment