mirror of https://github.com/kubernetes/kops.git
Merge pull request #2617 from WillemMali/move-verify-gendocs-to-makefile
Move verify-gendocs into Makefile and tighten Makefile safety
This commit is contained in:
commit
0c1fd6b272
26
Makefile
26
Makefile
|
@ -29,9 +29,13 @@ MAKEDIR:=$(strip $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))"))
|
|||
# Keep in sync with upup/models/cloudup/resources/addons/dns-controller/
|
||||
DNS_CONTROLLER_TAG=1.6.1
|
||||
|
||||
KOPS_RELEASE_VERSION=1.6.1
|
||||
KOPS_CI_VERSION=1.6.2-beta.1
|
||||
KOPS=${GOPATH_1ST}/bin/kops
|
||||
KOPS_RELEASE_VERSION = 1.6.1
|
||||
KOPS_CI_VERSION = 1.6.2-beta.1
|
||||
|
||||
# kops install location
|
||||
KOPS = ${GOPATH_1ST}/bin/kops
|
||||
# kops source root directory (without trailing /)
|
||||
KOPS_ROOT ?= $(patsubst %/,%,$(abspath $(dir $(firstword $(MAKEFILE_LIST)))))
|
||||
|
||||
GITSHA := $(shell cd ${GOPATH_1ST}/src/k8s.io/kops; git describe --always)
|
||||
|
||||
|
@ -413,13 +417,25 @@ verify-packages:
|
|||
|
||||
.PHONY: verify-gendocs
|
||||
verify-gendocs: kops
|
||||
KOPS_STATE_STORE= hack/verify-gendocs.sh
|
||||
TMP_DOCS="$$(mktemp -d)"; \
|
||||
\
|
||||
if ! command -v '$(KOPS)' 1>/dev/null 2>&1; then \
|
||||
echo "kops must be installed. Please run make. Aborting." 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
\
|
||||
'$(KOPS)' genhelpdocs --out "$$TMP_DOCS"; \
|
||||
\
|
||||
if ! diff -r "$$TMP_DOCS" '$(KOPS_ROOT)/docs/cli'; then \
|
||||
echo "Please run make gen-cli-docs." 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# verify-gendocs will call kops target
|
||||
# verify-package has to be after verify-gendoc, because with .gitignore for federation bindata
|
||||
# it bombs in travis. verify-gendoc generates the bindata file.
|
||||
.PHONY: ci
|
||||
ci: govet verify-gofmt verify-boilerplate verify-gendocs verify-packages nodeup-gocode examples test
|
||||
ci: govet verify-gofmt verify-boilerplate nodeup-gocode examples test | verify-gendocs verify-packages
|
||||
echo "Done!"
|
||||
|
||||
# --------------------------------------------------
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# 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.
|
||||
|
||||
. $(dirname "${BASH_SOURCE}")/common.sh
|
||||
|
||||
TMP_DOCS="${KUBE_ROOT}/.build/docs"
|
||||
rm -rf $TMP_DOCS
|
||||
mkdir -p $TMP_DOCS
|
||||
|
||||
BIN="${GOPATH}/bin/kops"
|
||||
|
||||
command -v $BIN >/dev/null 2>&1 || { echo >&2 "kops must be installed. Please run make. Aborting."; exit 1; }
|
||||
|
||||
$BIN genhelpdocs --out $TMP_DOCS
|
||||
|
||||
if [[ "$(diff $TMP_DOCS ${KUBE_ROOT}/docs/cli)" != "" ]]; then
|
||||
echo "Please run make gen-cli-docs."
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue