5 url: 'https://gerrit.onap.org/r/{project}'
6 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
11 name: doc-rules-patchset-created
15 - patchset-created-event
16 - comment-added-contains-event:
17 comment-contains-value: recheck
18 - comment-added-contains-event:
19 comment-contains-value: reverify
20 server-name: 'Primary'
22 - project-compare-type: 'ANT'
25 - branch-compare-type: 'ANT'
26 branch-pattern: '**/*'
27 - branch-compare-type: 'ANT'
28 branch-pattern: 'refs/tags/**'
35 . /lib/lsb/init-functions || exit 0
38 log_success_msg "Starting additional checks related to documentation."
39 log_success_msg "See https://git.onap.org/doc/doc-best-practice for example config files (master branch)."
40 log_success_msg "Modify example config files if you like to use them in a release branch."
41 log_success_msg "See https://wiki.onap.org/x/w4IEBw for the detailed procedure #02."
42 log_success_msg "In case of questions please contact the ONAP documentation team."
43 if [ ! -d docs ] ; then
44 log_success_msg "Directory docs not found. Skipping further checks."
47 for i in docs/index.rst docs/conf.py docs/requirements-docs.txt docs/_static/css/ribbon.css; do
49 log_failure_msg "$i missing. Please add it or remove the full docs directory."
52 log_success_msg "$i found."
55 for i in docs/conf.yaml; do
57 log_failure_msg "$i found. It is no longer required. Please remove it."
60 log_success_msg "$i not found."
63 filename="docs/tox.ini"
64 if [ ! -f $filename ] ; then
65 log_failure_msg "$filename missing. Please add it or remove the full docs directory."
68 log_success_msg "$filename found."
69 sphinxbuild_detected=0
71 while IFS="" read -r line || [ -n "$line" ] ; do
72 linenumber=$((linenumber+1))
73 if echo $line | grep -q '^[ \t]*sphinx-build.*' ; then
74 sphinxbuild_detected="1"
75 if echo $line | grep -q '^[ \t]*sphinx-build.* -W ' ; then
76 log_success_msg "sphinx-build option '-W' used in $filename, line $linenumber."
77 elif echo $line | grep -q ' \-b spelling ' ; then
78 log_warning_msg "sphinx-build option '-W' not used for spellcheck in $filename, line $linenumber."
81 log_failure_msg "sphinx-build option '-W' missing in $filename, line $linenumber. Please add it."
86 if [ "$sphinxbuild_detected" = "0" ]; then
87 log_failure_msg "Sphinx-build command(s) missing in $filename. Please add it."
90 unset sphinxbuild_detected
94 filename="docs/_static/css/ribbon.css"
95 if [ ! -f $filename ]; then
96 log_failure_msg "$filename missing. Please add it or remove the full docs directory."
99 log_success_msg "$filename found."
100 cssmaxwidth=$(grep '^[ \t]*max-width:' $filename | sed -e 's/^[ \t]*//' | sed -e 's/;$//');
101 if [[ ! $cssmaxwidth == *"max-width: 800px"* ]]; then
102 log_failure_msg "Setting 'max-width: 800px' missing in $filename. Please add it."
105 log_success_msg "Setting 'max-width: 800px' found in $filename."
110 if [ "$exitstatus" = "0" ]; then
111 if [ "$warning" = "0" ]; then
112 log_success_msg "Congratulations! No documentation problem(s) detected."
114 log_warning_msg "No major documentation problem(s) detected but there are warnings!"
117 log_failure_msg "Please fix the detected documentation problem(s)!"
123 node: ubuntu1804-docker-8c-8g
125 - doc-rules-patchset-created
129 project: $GERRIT_PROJECT