Skip to content

Improve doc build log notification #185

@doveye

Description

@doveye

Need a better way to pull out errors and warnings from the MkDocs build, so we don't have to read the Jenkins console log to spot issues.

Possible solution: the Jenkins Log Parser plugin can produce a page that pulls out the errors and warnings in an easy-to-read way. It requires a file that defines the strings to look for in the Jenkins console log, and whether they are errors or warnings. This file can be created via the "Create file" step at the start of the job, and referenced later in the job, in a post-build step

It's possible to add notification (email or Slack) too.

Here's a text file used for the Log Parser plugin in a different MkDocs build. We could re-use this:

# Rules used by the Log Parser plugin to look for errors, warnings etc in the console log. This file is specified elsewhere in the build config.
# These rules are case sensitive and create quick access links in the "Parsed Console Output" (see link in left sidebar).
# The job can be set to fail on Error, be unstable on Warning

# Rule format is /<error_type>/<text_to_match>/    For more info, see https://wiki.jenkins.io/display/JENKINS/Log+Parser+Plugin

# Start of mkdocs build section (looks for comment output by shell script) for grouping errors and warnings found after the line.
# also creates a quick access link under "Info"
start /Build: Build mkdocs/

# Git errors, eg the specified branch doesn't exist, or incorrect/old credentials were used (git will report "fatal: xxx")
error /fatal/
# Error if MkDocs reports an ERROR
error /ERROR/
# Error if no file (eg MkDocs output) was transferred over SSH
error /SSH: Transferred 0 file(s)/
# Error if a file can't be found, eg a sed command is run on a file that doesn't exist
error /No such file or directory/

# Warn if MkDocs reports a WARNING (eg if files specified in links don't exist - broken link)
warning /WARNING/
# Warn if MkDocs finds files that aren't in the nav
warning /The following pages exist in the docs directory, but are not/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions