Skip to content

Commit

Permalink
Move .generated_docs to docs/ so docs OWNERS can review / approve
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittrock committed Feb 16, 2017
1 parent 30e8953 commit 93ea016
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .generated_files
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ path-prefix vendor/
path-prefix api/swagger-spec/
path-prefix pkg/generated/

paths-from-repo .generated_docs
paths-from-repo docs/.generated_docs
2 changes: 1 addition & 1 deletion .generated_docs → docs/.generated_docs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.generated_docs
docs/.generated_docs
docs/admin/federation-apiserver.md
docs/admin/federation-controller-manager.md
docs/admin/kube-apiserver.md
Expand Down
1 change: 1 addition & 0 deletions docs/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ approvers:
- brendandburns
- smarterclayton
- thockin
- pwittrock
2 changes: 1 addition & 1 deletion hack/generate-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ kube::util::gen-docs "${KUBE_TEMP}"
kube::util::remove-gen-docs

# copy fresh docs into the repo.
# the shopt is so that we get .generated_docs from the glob.
# the shopt is so that we get docs/.generated_docs from the glob.
shopt -s dotglob
cp -af "${KUBE_TEMP}"/* "${KUBE_ROOT}"
shopt -u dotglob
14 changes: 7 additions & 7 deletions hack/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,35 +228,35 @@ kube::util::gen-docs() {

# create the list of generated files
pushd "${dest}" > /dev/null
touch .generated_docs
find . -type f | cut -sd / -f 2- | LC_ALL=C sort > .generated_docs
touch docs/.generated_docs
find . -type f | cut -sd / -f 2- | LC_ALL=C sort > docs/.generated_docs
popd > /dev/null
}

# Puts a placeholder for every generated doc. This makes the link checker work.
kube::util::set-placeholder-gen-docs() {
local list_file="${KUBE_ROOT}/.generated_docs"
local list_file="${KUBE_ROOT}/docs/.generated_docs"
if [ -e ${list_file} ]; then
# remove all of the old docs; we don't want to check them in.
while read file; do
if [[ "${list_file}" != "${KUBE_ROOT}/${file}" ]]; then
cp "${KUBE_ROOT}/hack/autogenerated_placeholder.txt" "${KUBE_ROOT}/${file}"
fi
done <"${list_file}"
# The .generated_docs file lists itself, so we don't need to explicitly
# The docs/.generated_docs file lists itself, so we don't need to explicitly
# delete it.
fi
}

# Removes previously generated docs-- we don't want to check them in. $KUBE_ROOT
# must be set.
kube::util::remove-gen-docs() {
if [ -e "${KUBE_ROOT}/.generated_docs" ]; then
if [ -e "${KUBE_ROOT}/docs/.generated_docs" ]; then
# remove all of the old docs; we don't want to check them in.
while read file; do
rm "${KUBE_ROOT}/${file}" 2>/dev/null || true
done <"${KUBE_ROOT}/.generated_docs"
# The .generated_docs file lists itself, so we don't need to explicitly
done <"${KUBE_ROOT}/docs/.generated_docs"
# The docs/.generated_docs file lists itself, so we don't need to explicitly
# delete it.
fi
}
Expand Down
2 changes: 1 addition & 1 deletion hack/update-generated-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ kube::util::gen-docs "${KUBE_TEMP}"
kube::util::remove-gen-docs

# Copy fresh docs into the repo.
# the shopt is so that we get .generated_docs from the glob.
# the shopt is so that we get docs/.generated_docs from the glob.
shopt -s dotglob
cp -af "${KUBE_TEMP}"/* "${KUBE_ROOT}"
shopt -u dotglob
Expand Down
8 changes: 4 additions & 4 deletions hack/verify-generated-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ kube::util::ensure-temp-dir
kube::util::gen-docs "${KUBE_TEMP}"

# Verify the list matches the expected list (diff should be empty)
if [[ "$(diff ${KUBE_ROOT}/.generated_docs ${KUBE_TEMP}/.generated_docs)" != "" ]]; then
if [[ "$(diff ${KUBE_ROOT}/docs/.generated_docs ${KUBE_TEMP}/docs/.generated_docs)" != "" ]]; then
echo "List of generated docs doesn't match a freshly built list. Please run hack/update-generated-docs.sh"
exit 1
fi

# Verify the files in the repo all contain the boilerplate instead of the actual
# content.
while read file; do
# Ignore .generated_docs-- it should not have the boilerplate!
[[ "${file}" == ".generated_docs" ]] && continue
# Ignore docs/.generated_docs-- it should not have the boilerplate!
[[ "${file}" == "docs/.generated_docs" ]] && continue

# Search for "hack/generate-docs.sh" as a proxy for the boilerplate content,
# since the munger adds a bunch of other stuff.
Expand All @@ -55,4 +55,4 @@ while read file; do
echo "Please run hack/update-generated-docs.sh"
exit 1
fi
done <"${KUBE_ROOT}/.generated_docs"
done <"${KUBE_ROOT}/docs/.generated_docs"

0 comments on commit 93ea016

Please sign in to comment.