From 708fedf70e9e96a57e13f19d24a69f7d9f9e97ed Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Tue, 29 May 2018 15:14:26 -0500 Subject: [PATCH] Documentation gating - Add gate for doc build per change and on merge - Add automation for document publishing Change-Id: If82ce4c97da5f2c47ba5de050b8f3982bd08d30b --- .zuul.yaml | 47 +++++++++++++++++++++++++++ tools/gate/playbooks/doc-build.yaml | 20 ++++++++++++ tools/gate/playbooks/doc-publish.yaml | 20 ++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 tools/gate/playbooks/doc-build.yaml create mode 100644 tools/gate/playbooks/doc-publish.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 2a08e068..bf13b551 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -14,6 +14,7 @@ check: jobs: - airship-drydock-lint-ws + - airship-drydock-doc-build - airship-drydock-lint-pep8: files: - ^.*\.py$ @@ -27,6 +28,7 @@ gate: jobs: - airship-drydock-lint-ws + - airship-drydock-doc-build - airship-drydock-lint-pep8: files: - ^.*\.py$ @@ -37,6 +39,9 @@ - airship-drydock-security-bandit: files: - ^.*\.py$ + post: + jobs: + - airship-drydock-doc-publish - nodeset: name: airship-drydock-single-node @@ -83,3 +88,45 @@ run: tools/gate/playbooks/security-bandit.yaml timeout: 300 nodeset: airship-drydock-single-node + +- job: + name: airship-drydock-doc-build + description: | + Locally build the documentation to check for errors + run: tools/gate/playbooks/doc-build.yaml + timeout: 300 + nodeset: airship-drydock-single-node + +- job: + name: airship-drydock-doc-publish + description: | + Publish documentation on airship-drydock.readthedocs.io + run: tools/gate/playbooks/doc-publish.yaml + timeout: 300 + nodeset: airship-drydock-single-node + +- secret: + name: readthedocs + data: + url: !encrypted/pkcs1-oaep + - dcOaNb6+3zCSp8rlmaA8U/v8kxzsB9MPqmbfbFSoyCsXOAMvluYSitmF7XpYdZLOXPOvm + +stE6m57dRBDlryymoLHVUxgeAkA/4YR1/78tF8vTLBDbWaLXVLTFBjx6jg17nS9X/UKs +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S++f2hB7xv8DonnyAqFLsH3os/BbkIIdkRwF2p5I/1az47aheET8m + QuZdGYtIzn0OeHfrKmUoF21D6G+zilwo9Gcy1qZQhWzvnIWgswCgzmnImVVT1DaEW97cW + lgKmZ4uApQ6/TitoiFb4l3R/6iQqqHA+yLl3LvFkmGbGwt4fB9su0+r5BpASQ8= diff --git a/tools/gate/playbooks/doc-build.yaml b/tools/gate/playbooks/doc-build.yaml new file mode 100644 index 00000000..b7b2aa16 --- /dev/null +++ b/tools/gate/playbooks/doc-build.yaml @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: primary + tasks: + - name: Build documents locally + make: + chdir: "{{ zuul.project.src_dir }}" + target: docs + register: result + failed_when: result.failed diff --git a/tools/gate/playbooks/doc-publish.yaml b/tools/gate/playbooks/doc-publish.yaml new file mode 100644 index 00000000..28095f7b --- /dev/null +++ b/tools/gate/playbooks/doc-publish.yaml @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: primary + tasks: + - name: Publish current merged documents on readthedocs.org + shell: | + curl -X POST -d "token={{ readthedocs.token }}" "{{ readthedocs.url }}" + register: result + failed_when: result.failed + no_log: true