nova/tools/releasenotes_tox.sh
melanie witt 7c3fd3c59d Make releasenotes reminder detect added and untracked notes
When 'tox -ereleasenotes' is run, the releasenotes are built from
the committed notes. We have a script that displays a reminder when
it detects uncommitted notes. It doesn't, however, detect newly
added notes or untracked notes.

This adds detection of added and untracked notes for displaying
the reminder message.

Change-Id: I5164f0089eae4a95bc3e68cd3b515ef23556b227
2016-09-28 21:52:28 +00:00

29 lines
603 B
Bash
Executable File

#!/usr/bin/env bash
rm -rf releasenotes/build
sphinx-build -a -E -W \
-d releasenotes/build/doctrees \
-b html \
releasenotes/source releasenotes/build/html
BUILD_RESULT=$?
UNCOMMITTED_NOTES=$(git status --porcelain | \
awk '$1 ~ "M|A|??" && $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}