Reminder that release notes are built from commits

This patch introduces a new tools/releasenotes_tox.sh script for the
tox -e releasenotes test environment. It will detect when there are
uncommitted release notes and print a reminder to commit them.

Change-Id: I54af12d7eb20b37263e23443900745884cffacea
This commit is contained in:
Artom Lifshitz
2016-07-06 14:39:57 -04:00
parent 1e8d704678
commit 5ee95b3240
2 changed files with 28 additions and 3 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
rm -rf releasenotes/build
sphinx-build -a -E -W \
-d releasenotes/build/doctrees \
-b html \
releasenotes/source releasenotes/build/html
UNCOMMITTED_NOTES=$(git status --porcelain | \
awk '$1 == "M" && $2 ~ /releasenotes\/notes/ {print $2}')
if [ "${UNCOMMITTED_NOTES}" ]
then
cat <<EOF
REMINDER: The following changes to release notes have not been committed:
${UNCOMMITTED_NOTES}
While that may be intentional, keep in mind that release notes are built from
committed changes, not the working directory.
EOF
fi
exit ${BUILD_RESULT}