Browse Source

[Doc, Jenkins] Build documentation in Jenkins

Documentation is built as another pipeline to check for build failures.
The result is discarded.
Wojtek Porczyk 4 years ago
parent
commit
5e5d783c4c
3 changed files with 18 additions and 2 deletions
  1. 2 2
      Documentation/howto-doc.rst
  2. 12 0
      Jenkinsfiles/Docs-18.04
  3. 4 0
      Jenkinsfiles/ubuntu-18.04.dockerfile

+ 2 - 2
Documentation/howto-doc.rst

@@ -11,7 +11,7 @@ documentation should be written in reST.
 API documentation of C |nbsp| language should be written as Doxygen comments
 (prefer Qt-style ``/*!`` and ``\param``) and then included in one of the
 ``.rst`` files (with appropriate description) using one of the `Breathe
-directives`_, like :rst:dir:`doxygenfunction` or :rst:dir:`doxygenstruct`. See
+directives`_, like ``.. doxygenfunction::`` or ``.. doxygenstruct::``. See
 `Breathe`_ documentation for more info. Do not use ``autodoxygen`` directives,
 and especially do not use ``.. doxygenfile::``, because documentation should be
 written as prose, not a |nbsp| coredump.
@@ -32,7 +32,7 @@ be different. In case of doubt, place them as they fit the narration of the
 document, not as they are placed in the source files.
 
 Documents should be grouped by general areas and presented using
-:rst:dir:`toctree` directive in :file:`index.rst` file. This causes them to be
+``.. toctree::`` directive in :file:`index.rst` file. This causes them to be
 included in TOC in the main document and also in sidebar on RTD.
 
 The documentation targets ``html`` output of Sphinx. The :file:`manpages/`

+ 12 - 0
Jenkinsfiles/Docs-18.04

@@ -0,0 +1,12 @@
+pipeline {
+        agent {
+              dockerfile { filename 'Jenkinsfiles/ubuntu-18.04.dockerfile' }
+        }
+        stages {
+                stage('Build') {
+                    steps {
+                        sh 'make -C Documentation html SPHINXOPTS="-W -n"'
+                    }
+                }
+        }
+}

+ 4 - 0
Jenkinsfiles/ubuntu-18.04.dockerfile

@@ -19,14 +19,18 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \
     linux-headers-4.15.0-20-generic \
     net-tools \
     python \
+    python3-pip \
     python3-protobuf \
     python3-pytest \
+    python3-breathe \
     texinfo \
     wget \
     curl \
     libprotobuf-c-dev \
     protobuf-c-compiler
 
+RUN pip3 install 'Sphinx>=1.8' sphinx_rtd_theme recommonmark
+
 # Add the user UID:1001, GID:1001, home at /leeroy
 RUN groupadd -r leeroy -g 1001 && useradd -u 1001 -r -g leeroy -m -d /leeroy -c "Leeroy Jenkins" leeroy && \
     chmod 755 /leeroy