Browse Source

Merge "(zuul) Add doc build and publish jobs"

Zuul 8 months ago
parent
commit
1745e620a1
8 changed files with 134 additions and 11 deletions
  1. 1
    0
      .gitignore
  2. 62
    0
      .zuul.yaml
  3. 4
    9
      Makefile
  4. 2
    0
      doc/requirements.txt
  5. 4
    2
      doc/source/conf.py
  6. 23
    0
      gate/playbooks/doc-build.yaml
  7. 23
    0
      gate/playbooks/doc-publish.yaml
  8. 15
    0
      tox.ini

+ 1
- 0
.gitignore View File

@@ -4,3 +4,4 @@
4 4
 !/doc/source/_static/
5 5
 /AUTHORS
6 6
 /ChangeLog
7
+.tox

+ 62
- 0
.zuul.yaml View File

@@ -0,0 +1,62 @@
1
+- project:
2
+    check:
3
+      jobs:
4
+        - airship-specs-doc-build
5
+
6
+    gate:
7
+      jobs:
8
+        - airship-specs-doc-build
9
+
10
+    post:
11
+      jobs:
12
+        - airship-specs-doc-publish
13
+
14
+- nodeset:
15
+    name: airship-specs-single-node
16
+    nodes:
17
+      - name: primary
18
+        label: ubuntu-xenial
19
+
20
+- job:
21
+    name: airship-specs-doc-build
22
+    description: |
23
+      Build documents locally to validate functionality
24
+    run: gate/playbooks/doc-build.yaml
25
+    timeout: 900
26
+    nodeset: airship-specs-single-node
27
+
28
+- job:
29
+    name: airship-specs-doc-publish
30
+    description: |
31
+      Publish documentation on airship-specs.readthedocs.io
32
+    run: gate/playbooks/doc-publish.yaml
33
+    secrets:
34
+      - airship_specs_readthedocs
35
+    timeout: 300
36
+    nodeset: airship-specs-single-node
37
+
38
+- secret:
39
+    name: airship_specs_readthedocs
40
+    data:
41
+      url: !encrypted/pkcs1-oaep
42
+        - w+FhusV0G8CTwapZN61r2y/X2hqy94gW8DocxV2voO/g0oNm+esDhDUxUR4XaihU+68yL
43
+          VOhbUbWBAGFs3oHGEPQMzMeSuSIFgctp9v91tLnECulNzmXm44pLr000w61EA2K5H2YRI
44
+          n9T8vOCBLSOnw4jjxp4I1G0x4uAZv6JNzk112hkwvEAyGsGBm00M88nJiNEHm1luIRt2Q
45
+          adS3hMFDLvpJ2D3C286bGeuCTbYWVMhPic11rMtMHOigQwrQs/pUWQgh+W06fg6G9Iokn
46
+          W4bWVVHdRVgRx08eG13Mec8J0Qn+sQhU8/cpZOob/XuYh5+jntTnTqB7Ig/xOY1AY9isy
47
+          yyaXHcQ/KJ7Px6kDfckIp9rlwnQ8vU53CnTgHaColx/2Qsrzaww/52JvBUGp/61Y/Folu
48
+          /UF2jnHBSIAT6hRosbkZcLY45J0sDBFcKXBJi9p/5CJTCX+Dg1OKL4hEPX2p1KQzGz+T6
49
+          uQiRbts5/+RpXE2qgw+RGhORIdLTxokKwyeNf+j0OBGMbho/eIo3gybo0AvPiDRwnBA6F
50
+          wd4Ub+z3tDGmt+9U8eLcTWRSArqlBFjgf9DMs2u4D1pXAtXXi0QYYF5YgnJWfVHAHVwkO
51
+          e2n7MMBVs/cHEryC8jYVC9R6yOcaJPY3q3FujQIYLiH0op2cRUeTOIgP4REMwg=
52
+      token: !encrypted/pkcs1-oaep
53
+        - JpdDUf95LcYP3ZblOsky/fkScHgOvXeSIS7OpBmWTHRTjWDKi6ZcmFwT1AA5h1oH0dKBC
54
+          8p40U4zVXfJg2S0aXbo8/VPNLfC2QwZG+vJqsrm+7O3Db2rahwwWqBv4DYsazcrlFtsjZ
55
+          MA8Qb+NAS68f2gSWbLu3tR8f6wf18J++hc3E3lfa+Qzt2hQDIkjXyPaFWavuzftw6ny4G
56
+          ViKHn503HEJ3wyGVZ/OzI/F7AOCnGo08QURSD7+1+ktp0FB9Namn6BfaKPKTunaMq1ECV
57
+          rJIubFmbz3Zv0r+H/eU1sJrFbSY+TcgHC9aSDU2jXfmGsiABptSGPoaqkjio7WSWlRQNg
58
+          77ws8o1kZTagW9fS1ohJ2lFnEBmWtATY5jaOsvdc6zmzmTpFgyxmaYZrmZMU5X7yO/iDa
59
+          Sn2CM2II6BecLtVi3VQTBCVEGqo9JVqD8NU1dDz5arz56+p+QBLv4YpjhHLe4A3Z5FmOo
60
+          qYrJiRZpx0gVgxJiWx58XJJ3UvlN9LpjCxRoySlL9KPYJFzRmbDUSuduf9scJ5EbzsaQ/
61
+          fIxmjGBs9LKjo+2wppRtabVQK+YyQ5KZW+fMzheAqwJt7uB1aJ5XMS8UZWDxH6/bgW8RH
62
+          MQK7Hi+9HD8GWsTm5YcdXuIZmhw27/iFoY0dcgBYiIrhMHwDXi9MzaZSfBeuzY=

+ 4
- 9
Makefile View File

@@ -2,19 +2,14 @@
2 2
 #
3 3
 
4 4
 # You can set these variables from the command line.
5
+# TODO: Incorporate these vars into tox file
5 6
 SPHINXOPTS    = -a -E -W
6 7
 SPHINXBUILD   = sphinx-build
7 8
 SPHINXPROJ    = airship-specs
8 9
 SOURCEDIR     = doc/source
9 10
 BUILDDIR      = doc/build
10 11
 
11
-# Put it first so that "make" without argument is like "make help".
12
-help:
13
-	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
12
+docs:
13
+	tox
14 14
 
15
-.PHONY: help Makefile
16
-
17
-# Catch-all target: route all unknown targets to Sphinx using the new
18
-# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
19
-%: Makefile
20
-	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
15
+%: docs

+ 2
- 0
doc/requirements.txt View File

@@ -0,0 +1,2 @@
1
+sphinx==1.7.6
2
+sphinx_rtd_theme==0.4.1

+ 4
- 2
doc/source/conf.py View File

@@ -5,6 +5,7 @@
5 5
 # This file does only contain a selection of the most common options. For a
6 6
 # full list see the documentation:
7 7
 # http://www.sphinx-doc.org/en/master/config
8
+import sphinx_rtd_theme
8 9
 
9 10
 # -- Path setup --------------------------------------------------------------
10 11
 
@@ -74,7 +75,8 @@ pygments_style = 'sphinx'
74 75
 # The theme to use for HTML and HTML Help pages.  See the documentation for
75 76
 # a list of builtin themes.
76 77
 #
77
-html_theme = 'alabaster'
78
+html_theme = "sphinx_rtd_theme"
79
+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
78 80
 
79 81
 # Theme options are theme-specific and customize the look and feel of a theme
80 82
 # further.  For a list of options available for each theme, see the
@@ -152,4 +154,4 @@ texinfo_documents = [
152 154
     (master_doc, 'airship-specs', 'airship-specs Documentation',
153 155
      author, 'airship-specs', 'One line description of project.',
154 156
      'Miscellaneous'),
155
-]
157
+]

+ 23
- 0
gate/playbooks/doc-build.yaml View File

@@ -0,0 +1,23 @@
1
+# Licensed under the Apache License, Version 2.0 (the "License");
2
+# you may not use this file except in compliance with the License.
3
+# You may obtain a copy of the License at
4
+#
5
+#     http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+# Unless required by applicable law or agreed to in writing, software
8
+# distributed under the License is distributed on an "AS IS" BASIS,
9
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+# See the License for the specific language governing permissions and
11
+# limitations under the License.
12
+
13
+# Combine several test tasks into a single playbook
14
+# to minimize Zuul node consumption
15
+
16
+- hosts: primary
17
+  tasks:
18
+    - name: Build documents locally
19
+      make:
20
+        chdir: "{{ zuul.project.src_dir }}"
21
+        target: docs
22
+      register: result
23
+

+ 23
- 0
gate/playbooks/doc-publish.yaml View File

@@ -0,0 +1,23 @@
1
+# Licensed under the Apache License, Version 2.0 (the "License");
2
+# you may not use this file except in compliance with the License.
3
+# You may obtain a copy of the License at
4
+#
5
+#     http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+# Unless required by applicable law or agreed to in writing, software
8
+# distributed under the License is distributed on an "AS IS" BASIS,
9
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+# See the License for the specific language governing permissions and
11
+# limitations under the License.
12
+
13
+- hosts: primary
14
+  tasks:
15
+    - name: Publish current merged documents on readthedocs
16
+      no_log: true
17
+      uri:
18
+        method: 'POST'
19
+        body_format: 'json'
20
+        url: '{{ airship_specs_readthedocs.url | trim}}'
21
+        body:
22
+          token: '{{ airship_specs_readthedocs.token | trim }}'
23
+      register: result

+ 15
- 0
tox.ini View File

@@ -0,0 +1,15 @@
1
+[tox]
2
+envlist = docs
3
+skipsdist = True
4
+
5
+[testenv]
6
+basepython=python3
7
+deps=
8
+  -rdoc/requirements.txt
9
+
10
+[testenv:docs]
11
+whitelist_externals=
12
+  rm
13
+commnds=
14
+  rm -rf doc/build
15
+  sphinx-build -b html doc/source doc/build -a -E -W

Loading…
Cancel
Save