tripleo-validations/tools/releasenotes_tox.sh
Gael Chamoulaud 4d309d8e54 Linting hardening with pre-commit
- Adds bashate test using v0.6.0
- Bump pre-commit-hooks release to v2.2.4
- Bump ansible-lint release to v4.1.0a0
- Fix some minor flake8 errors

Change-Id: I66b796fab1d8651163226febbc4e99648a9ecc6a
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
(cherry picked from commit cac3e7101d)
2019-08-19 10:49:54 +02:00

28 lines
600 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" && $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}