hack and hooks scripts for generating swagger docs

This commit is contained in:
Anastasis Andronidis
2015-07-05 19:15:36 +02:00
parent ff2fcd43f7
commit e27a76ae81
7 changed files with 238 additions and 38 deletions

View File

@@ -93,8 +93,8 @@ files_need_description=()
# Check API schema definitions for field descriptions
for file in $(git diff --cached --name-only --diff-filter ACM | egrep "pkg/api/v.[^/]*/types\.go" | grep -v "third_party"); do
# Check for files with fields without description tags
descriptionless=$(hack/after-build/verify-description.sh "${file}")
if [[ "$descriptionless" != "" ]]; then
descriptionless=$(hack/after-build/verify-description.sh "${file}" > /dev/null; echo $?)
if [[ "$descriptionless" -ne "0" ]]; then
files_need_description+=("${file}")
fi
done
@@ -158,6 +158,18 @@ else
fi
echo "${reset}"
echo -ne "Checking for swagger type documentation that need updating... "
if ! hack/after-build/verify-generated-swagger-docs.sh > /dev/null; then
echo "${red}ERROR!"
echo "Swagger type documentation needs to be updated."
echo "To regenerate the spec, run:"
echo " hack/update-generated-swagger-docs.sh"
exit_code=1
else
echo "${green}OK"
fi
echo "${reset}"
echo -ne "Checking for swagger spec that need updating... "
if ! hack/after-build/verify-swagger-spec.sh > /dev/null; then
echo "${red}ERROR!"