address host dir vs docker dir issue

This commit is contained in:
Chao Xu
2015-11-06 16:58:15 -08:00
parent 358221f9fd
commit 4e4c67c624
2 changed files with 33 additions and 34 deletions

View File

@@ -26,15 +26,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
API_REFERENCE_DOCS_ROOT="${KUBE_ROOT}/docs/api-reference"
# Use REPO_DIR if provided so we can set it to the host-resolvable path
# to the repo root if we are running this script from a container with
# docker mounted in as a volume.
# We pass the host output dir to update-api-reference-docs.sh, but use
# the regular one to compute diff (they will be the same if running this
# test on the host, potentially different if running in a container).
REPO_DIR=${REPO_DIR:-"${KUBE_ROOT}"}
HOST_OUTPUT_DIR="${REPO_DIR}/_tmp/api-reference"
TMP_OUTPUT_DIR="${KUBE_ROOT}/_tmp/api-reference"
HOST_OUTPUT_DIR="${KUBE_ROOT}/_tmp/api-reference"
mkdir -p ${HOST_OUTPUT_DIR}
TMP_ROOT="${KUBE_ROOT}/_tmp"
# Generate API reference docs in tmp.
@@ -42,7 +35,7 @@ TMP_ROOT="${KUBE_ROOT}/_tmp"
echo "diffing ${API_REFERENCE_DOCS_ROOT} against freshly generated docs"
ret=0
diff -Naupr -I 'Last update' --exclude=*.md "${API_REFERENCE_DOCS_ROOT}" "${TMP_OUTPUT_DIR}" || ret=$?
diff -Naupr -I 'Last update' --exclude=*.md "${API_REFERENCE_DOCS_ROOT}" "${HOST_OUTPUT_DIR}" || ret=$?
rm -rf "${TMP_ROOT}"
if [[ $ret -eq 0 ]]
then