diff --git a/build/root/Makefile b/build/root/Makefile index d7dbed83456..51f77b8c617 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -112,10 +112,12 @@ define VERIFY_HELP_INFO # # Args: # BRANCH: Branch to be passed to verify-godeps.sh script. +# WHAT: List of checks to run # # Example: # make verify # make verify BRANCH=branch_x +# make verify WHAT="bazel typecheck" endef .PHONY: verify ifeq ($(PRINT_HELP),y) diff --git a/hack/jenkins/verify-dockerized.sh b/hack/jenkins/verify-dockerized.sh index c8d981bbec4..ba34d07df34 100755 --- a/hack/jenkins/verify-dockerized.sh +++ b/hack/jenkins/verify-dockerized.sh @@ -40,5 +40,4 @@ export LOG_LEVEL=4 cd /go/src/k8s.io/kubernetes -./hack/install-etcd.sh make verify diff --git a/hack/lib/etcd.sh b/hack/lib/etcd.sh index e887426a083..9bb960cb448 100755 --- a/hack/lib/etcd.sh +++ b/hack/lib/etcd.sh @@ -103,6 +103,9 @@ kube::etcd::cleanup() { kube::etcd::install() { ( cd "${KUBE_ROOT}/third_party" + if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-* ]]; then + return # already installed + fi if [[ $(uname) == "Darwin" ]]; then download_file="etcd-v${ETCD_VERSION}-darwin-amd64.zip" url="https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${download_file}" diff --git a/hack/make-rules/verify.sh b/hack/make-rules/verify.sh index 7ed9d3723e6..13fe2a13b4f 100755 --- a/hack/make-rules/verify.sh +++ b/hack/make-rules/verify.sh @@ -73,6 +73,17 @@ function is-quick { return 1 } +function is-explicitly-chosen { + local name="${1#verify-}" + name="${name%.*}" + for e in ${WHAT}; do + if [[ $e == "$name" ]]; then + return + fi + done + return 1 +} + function run-cmd { local filename="${2##*/verify-}" local testname="${filename%%.*}" @@ -109,13 +120,19 @@ function run-checks { for t in $(ls ${pattern}) do local check_name="$(basename "${t}")" - if is-excluded "${t}" ; then - echo "Skipping ${check_name}" - continue - fi - if ${QUICK} && ! is-quick "${t}" ; then - echo "Skipping ${check_name} in quick mode" - continue + if [[ ! -z ${WHAT:-} ]]; then + if ! is-explicitly-chosen "${check_name}"; then + continue + fi + else + if is-excluded "${t}" ; then + echo "Skipping ${check_name}" + continue + fi + if ${QUICK} && ! is-quick "${t}" ; then + echo "Skipping ${check_name} in quick mode" + continue + fi fi echo -e "Verifying ${check_name}" local start=$(date +%s) diff --git a/hack/verify-openapi-spec.sh b/hack/verify-openapi-spec.sh index 159e73f853f..08b1edcbe3b 100755 --- a/hack/verify-openapi-spec.sh +++ b/hack/verify-openapi-spec.sh @@ -22,6 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env +kube::etcd::install make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver diff --git a/hack/verify-swagger-spec.sh b/hack/verify-swagger-spec.sh index f3ca2217b49..92ee2bcb6b1 100755 --- a/hack/verify-swagger-spec.sh +++ b/hack/verify-swagger-spec.sh @@ -22,6 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env +kube::etcd::install make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver