-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare the documentation structure and configs required to build a documentation.
- Loading branch information
1 parent
b18652f
commit 06a9aa1
Showing
13 changed files
with
321 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build documentation and deploy it to GitHub Pages | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
# Default to bash | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: ./docs/requirements.txt | ||
- name: Build documentation | ||
run: | | ||
docs/build-docs.sh | ||
- name: Upload artifacts | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs/build/html/ | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,6 @@ CI_TOOLS_REPO | |
.vscode/ | ||
go.work | ||
go.work.sum | ||
|
||
# doc | ||
docs/build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Contribute to the test-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,3 +316,8 @@ gowork: ## Generate go.work file to support our multi module repository | |
operator-lint: gowork ## Runs operator-lint | ||
GOBIN=$(LOCALBIN) go install github.com/gibizer/[email protected] | ||
go vet -vettool=$(LOCALBIN)/operator-lint ./... ./api/... | ||
|
||
##@ Generate documentation | ||
.PHONY: docs | ||
docs: ## Create documentation under docs/build/html | ||
docs/build-docs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
TEMP_VENV_ENV="$(mktemp -d)" | ||
DOCS_DIR="./docs" | ||
|
||
python -m venv ${TEMP_VENV_ENV} && source ${TEMP_VENV_ENV}/bin/activate | ||
|
||
pip install -c ${UPPER_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/master} -r ${DOCS_DIR}/requirements.txt | ||
|
||
# Run linter on docs, skipping antsibull-docs output as it isn't up to spec | ||
doc8 --config ${DOCS_DIR}/doc8.ini ${DOCS_DIR}/source | ||
|
||
sphinx-build -a -E -W -d ${DOCS_DIR}/build/doctrees --keep-going -b html ${DOCS_DIR}/source ${DOCS_DIR}/build/html -T | ||
|
||
deactivate | ||
rm -fr ${TEMP_VENV_ENV} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[doc8] | ||
extensions = .rst | ||
ignore = D001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ansible-core>=2.14.6 | ||
sphinx>=6.2.1 # BSD | ||
sphinx-autobuild>=2021.3.1 | ||
sphinx_rtd_theme>=1.2.2 | ||
doc8>=0.8.1 # Apache-2.0 | ||
sphinxemoji | ||
myst-parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# this documentation build configuration file can be | ||
# created using sphinx-quickstart | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
import os | ||
import re | ||
|
||
# -- General configuration ------------------------------------------------ | ||
|
||
# If your documentation needs a minimal Sphinx version, state it here. | ||
# | ||
# needs_sphinx = '1.0' | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = ['myst_parser', | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.doctest', | ||
'sphinx.ext.intersphinx', | ||
'sphinx.ext.todo', | ||
'sphinx.ext.viewcode', | ||
'sphinxemoji.sphinxemoji', | ||
'reno.sphinxext'] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# The suffix(es) of source filenames. | ||
# You can specify multiple suffix as a list of string: | ||
# source_suffix = ['.rst', '.md'] | ||
# source_suffix = '.rst' | ||
source_suffix = { | ||
'.rst': 'restructuredtext', | ||
'.md': 'markdown', | ||
} | ||
|
||
# The master toctree document. | ||
master_doc = 'index' | ||
|
||
# General information about the project. | ||
project = u'ci-framework' | ||
copyright = u'2023, Red Hat' | ||
|
||
# Versions | ||
# Get the latest release. Subject to be tagged as following: | ||
# v1.0 | ||
# v2.0 | ||
# v2.1 | ||
get_version_command = 'git tag --sort=committerdate -l v* | tail -1' | ||
release = re.sub('^v', '', os.popen(get_version_command).read().strip()) | ||
version = release | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
# | ||
# This is also used if you do content translation via gettext catalogs. | ||
# Usually you set "language" from the command line for these cases. | ||
language = 'en' | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This patterns also effect to html_static_path and html_extra_path | ||
exclude_patterns = [] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = 'sphinx' | ||
|
||
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
todo_include_todos = True | ||
|
||
|
||
# -- Options for HTML output ---------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
html_theme = 'sphinx_rtd_theme' | ||
|
||
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options available for each theme, see the | ||
# documentation. | ||
# | ||
# html_theme_options = {} | ||
|
||
# -- Options for HTMLHelp output ------------------------------------------ | ||
|
||
# Output file base name for HTML help builder. | ||
# htmlhelp_basename = 'doc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# this documentation build configuration file can be | ||
# created using sphinx-quickstart | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
import os | ||
import re | ||
|
||
# -- General configuration ------------------------------------------------ | ||
|
||
# If your documentation needs a minimal Sphinx version, state it here. | ||
# | ||
# needs_sphinx = '1.0' | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
"myst_parser", | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.todo", | ||
"sphinx.ext.viewcode", | ||
"sphinxemoji.sphinxemoji", | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
# The suffix(es) of source filenames. | ||
# You can specify multiple suffix as a list of string: | ||
# source_suffix = ['.rst', '.md'] | ||
# source_suffix = '.rst' | ||
source_suffix = { | ||
".rst": "restructuredtext", | ||
".md": "markdown", | ||
} | ||
|
||
# The master toctree document. | ||
master_doc = "index" | ||
|
||
# General information about the project. | ||
project = "test-operator" | ||
copyright = "2023, Red Hat" | ||
|
||
# Versions | ||
# Get the latest release. Subject to be tagged as following: | ||
# v1.0 | ||
# v2.0 | ||
# v2.1 | ||
get_version_command = "git tag --sort=committerdate -l v* | tail -1" | ||
release = re.sub("^v", "", os.popen(get_version_command).read().strip()) | ||
version = release | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
# | ||
# This is also used if you do content translation via gettext catalogs. | ||
# Usually you set "language" from the command line for these cases. | ||
language = "en" | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This patterns also effect to html_static_path and html_extra_path | ||
exclude_patterns = [] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = "sphinx" | ||
|
||
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
todo_include_todos = True | ||
|
||
|
||
# -- Options for HTML output ---------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# html_theme = "sphinx_rtd_theme" | ||
# html_logo = "images/logo_cifmw_200.png" | ||
|
||
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options available for each theme, see the | ||
# documentation. | ||
# | ||
# html_theme_options = {} | ||
|
||
# -- Options for HTMLHelp output ------------------------------------------ | ||
|
||
# Output file base name for HTML help builder. | ||
# htmlhelp_basename = 'doc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../CONTRIBUTING.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. documentation master file | ||
============= | ||
test-operator | ||
============= | ||
|
||
Welcome to the documentation for test-operator. This documentation is designed | ||
to help you get up and running with our project as quickly and smoothly as | ||
possible. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Overview | ||
|
||
readme.md | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: For Contributors | ||
|
||
contributing.md | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../README.md |