def command_check_docs(): # clean the docs first to get all warnings command_docs_clean() build_fail_regex = re.compile('^.*ERROR.*$|^.*WARNING.*$|^.*SEVERE.*$|^.*Exception occurred.*$', re.MULTILINE) result = 0 cmd = _docs_build_command() log(cmd) stdout = sh(cmd, wait=True, verbose=False) errors = re.findall(build_fail_regex, stdout) if len(errors) > 0: for e in errors: error(e) result += 1 error('Build failed. Documentation contains errors or warnings.') if result == 0: ok('HTML build') print 'Checking links' result += check_documentation_links('build/docs') if result == 0: ok('docs links') if result == 0: ok('Documentation build succeeded') else: error('Documentation build failed') return result