Merge "Replace venv with tox for documentation builds"

This commit is contained in:
Zuul 2020-05-08 16:50:03 +00:00 committed by Gerrit Code Review
commit cb1833c3b3
7 changed files with 25 additions and 60 deletions

2
.gitignore vendored
View File

@ -22,4 +22,4 @@ bin/
.vscode/
# Sphinx build venv
venv/
.tox/

View File

@ -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:

View File

@ -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

View File

@ -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

18
tox.ini Normal file
View File

@ -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

View File

@ -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

View File

@ -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