Add version check to product-docs script
@@ -16,6 +16,10 @@ AGENT_REPO_BASE="$SCRIPT_DIR/../.."
PRODUCT_DOCS_REPO="${PRODUCT_DOCS_REPO:-$AGENT_REPO_BASE/../product-docs}"
AGENT_PRODUCT_DOCS="$PRODUCT_DOCS_REPO/integrations/agent"
+check_pandoc_version() {
+ pandoc --version | grep 'pandoc 2.5'
+}
+
header_comment() {
printf ".. Generated by scripts/docs/to-product-docs in signalfx-agent repo. DO NOT EDIT in product-docs!!\n\n"
}
@@ -47,11 +51,13 @@ reset_repo() {
git -C $PRODUCT_DOCS_REPO checkout smart-agent
# If there aren't any pending commits in the smart-agent branch, then reset
# with the latest master first
- if [[ -z "$(git cherry -v origin/master origin/smart-agent)" ]]; then
+ if [[ -z "$(git cherry -v origin/master origin/smart-agent || echo '')" ]]; then
git -C $PRODUCT_DOCS_REPO reset --hard origin/master
fi
}
+check_pandoc_version
+
[ -d $PRODUCT_DOCS_REPO ] || \
(echo "product-docs repo dir cannot be found at $PRODUCT_DOCS_REPO; please set \$PRODUCT_DOCS_REPO" && exit 1)
@@ -118,3 +124,5 @@ header_comment | \
convert_relative_links \
> $AGENT_PRODUCT_DOCS/overview.rst
+# Make sure we can build the project in sphinx
+make -C $AGENT_PRODUCT_DOCS html
