diff --git a/.gitignore b/.gitignore index 4dbe546fa..2038ceeb2 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ bin/ .vscode/ # Sphinx build venv -venv/ +.tox/ diff --git a/Makefile b/Makefile index d19d2ae76..17e0814db 100644 --- a/Makefile +++ b/Makefile @@ -38,13 +38,6 @@ PROXY ?= http://proxy.foo.com:8000 NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local USE_PROXY ?= false -# Sphinx document options -PYTHON_EXECUTABLE := python3 -SPHINXBUILD ?= sphinx-build -SOURCEDIR = docs/source -BUILDDIR = docs/build/html -REQUIREMENTSTXT := docs/requirements.txt - # Godoc server options GD_PORT ?= 8080 @@ -153,11 +146,7 @@ clean: .PHONY: docs docs: - @$(PYTHON_EXECUTABLE) -m venv venv - source ./venv/bin/activate - @$(PYTHON_EXECUTABLE) -m pip install -r ${REQUIREMENTSTXT} - @$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" - rm -rf venv + tox .PHONY: godoc godoc: diff --git a/playbooks/airship-airshipctl-build-docs.yaml b/playbooks/airship-airshipctl-build-docs.yaml deleted file mode 100644 index abb93cdb7..000000000 --- a/playbooks/airship-airshipctl-build-docs.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# 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: all - become: yes - roles: - - ensure-python - - airshipctl-build-docs - - fetch-sphinx-output diff --git a/roles/airshipctl-build-docs/tasks/main.yaml b/roles/airshipctl-build-docs/tasks/main.yaml deleted file mode 100644 index 5cdcac65f..000000000 --- a/roles/airshipctl-build-docs/tasks/main.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# 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. - -- name: Buid airshipctl Docs - make: - chdir: "{{ zuul.project.src_dir }}" - target: docs diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..5a4dd9fb7 --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = docs +skipsdist = true + +[testenv] +setenv = VIRTUAL_ENV={envdir} + LANGUAGE=en_US + LC_ALL=en_US.utf-8 +passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY + +[testenv:docs] +basepython = python3 +whitelist_externals = rm +deps = + -r{toxinidir}/docs/requirements.txt +commands = + rm -rf docs/build + sphinx-build docs/source docs/build/html diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index ef2804ee7..2dbea9797 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -15,14 +15,6 @@ run: tests/ansible/role-test-runner.yaml nodeset: airship-airshipctl-single-node -- job: - name: airship-airshipctl-build-docs - nodeset: airship-airshipctl-single-node - run: playbooks/airship-airshipctl-build-docs.yaml - vars: - sphinx_build_dir: docs/build - python_version: 3.7 - - job: name: airship-airshipctl-lint-unit pre-run: playbooks/airship-airshipctl-deploy-docker.yaml diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 8891203b2..59611ecea 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -11,16 +11,17 @@ # limitations under the License. - project: + templates: + - docs-on-readthedocs vars: - # NOTE(drewwalters96): These variables are required for the documentation promotion job. - download_artifact_job: airship-airshipctl-build-docs - download_artifact_pipeline: gate + rtd_project_name: airship-airshipctl + rtd_webhook_id: 112688 + sphinx_build_dir: docs/build check: jobs: - airship-airshipctl-roles-test: files: - "roles/*" - - airship-airshipctl-build-docs - airship-airshipctl-lint-unit - airship-airshipctl-build-image # - airship-airshipctl-functional-existing-k8s TODO: Enable this when functional tests exist, and a cluster is up @@ -28,7 +29,6 @@ - airship-airshipctl-32GB-gate-test gate: jobs: - - airship-airshipctl-build-docs - airship-airshipctl-lint-unit - airship-airshipctl-build-image # - airship-airshipctl-functional-existing-k8s TODO: Enable this when functional tests exist, and a cluster is up