Add godeps for man page autogeneration

This commit is contained in:
Eric Paris
2015-02-05 22:01:32 -05:00
parent a70fd60640
commit 8e64be1c66
68 changed files with 11671 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs
"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genman
# Get the absolute path of the directory component of a file, i.e. the
# absolute path of the dirname of $1.
@@ -67,19 +67,25 @@ case "$(uname -m)" in
esac
# Find binary
locations=(
doc_locations=(
"${KUBE_ROOT}/_output/dockerized/bin/${host_os}/${host_arch}/gendocs"
"${KUBE_ROOT}/_output/local/bin/${host_os}/${host_arch}/gendocs"
"${KUBE_ROOT}/platforms/${host_os}/${host_arch}/gendocs"
)
gendocs=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
gendocs=$( (ls -t "${doc_locations[@]}" 2>/dev/null || true) | head -1 )
man_locations=(
"${KUBE_ROOT}/_output/dockerized/bin/${host_os}/${host_arch}/genman"
"${KUBE_ROOT}/_output/local/bin/${host_os}/${host_arch}/genman"
"${KUBE_ROOT}/platforms/${host_os}/${host_arch}/genman"
)
genman=$( (ls -t "${man_locations[@]}" 2>/dev/null || true) | head -1 )
if [[ ! -x "$gendocs" ]]; then
if [[ ! -x "$gendocs" || ! -x "$genman" ]]; then
{
echo "It looks as if you don't have a compiled gendocs binary"
echo "It looks as if you don't have a compiled gendocs or genman binary"
echo
echo "If you are running from a clone of the git repo, please run"
echo "'./hack/build-go.sh cmd/gendocs'."
echo "'./hack/build-go.sh cmd/gendocs cmd/genman'."
} >&2
exit 1
fi
@@ -87,4 +93,4 @@ fi
KUBECTL_DOC="docs/kubectl.md"
${gendocs} > ${KUBECTL_DOC}
${genman} "${KUBE_ROOT}/docs/man/man1"