docs: versioning fixes (#233)

1) Allow release string to be specified by env var
2) Add pre-release warning text

This will be overriden during the official tagged doc builds in the main repo.

Signed-off-by: Matt Klein <mklein@lyft.com>
pull/234/head
Matt Klein 7 years ago committed by htuch
parent 320b5afbd0
commit a64d794478
  1. 5
      docs/build.sh
  2. 104
      docs/conf.py
  3. 9
      docs/root/index.rst

@ -38,4 +38,9 @@ do
cp -f bazel-bin/"${p}" "${GENERATED_RST_DIR}/$p"
done
BUILD_SHA=$(git rev-parse HEAD)
[[ -z "${ENVOY_DOCS_VERSION_STRING}" ]] && ENVOY_DOCS_VERSION_STRING=data-plane-api-"${BUILD_SHA:0:6}"
[[ -z "${ENVOY_DOCS_RELEASE_LEVEL}" ]] && ENVOY_DOCS_RELEASE_LEVEL=pre-release
export ENVOY_DOCS_VERSION_STRING ENVOY_DOCS_RELEASE_LEVEL
sphinx-build -W -b html "${GENERATED_RST_DIR}" "${DOCS_OUTPUT_DIR}"

@ -15,7 +15,14 @@
import sphinx_rtd_theme
import sys
import os
import git
def setup(app):
app.add_config_value('release_level', '', 'env')
if not os.environ.get('ENVOY_DOCS_RELEASE_LEVEL'):
raise Exception("ENVOY_DOCS_RELEASE_LEVEL env var must be defined")
release_level = os.environ['ENVOY_DOCS_RELEASE_LEVEL']
# 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
@ -30,8 +37,7 @@ import git
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinxcontrib.httpdomain', 'sphinx.ext.extlinks']
extensions = ['sphinxcontrib.httpdomain', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig']
extlinks = {'repo': ('https://github.com/envoyproxy/envoy/blob/master/%s', '')}
# Add any paths that contain templates here, relative to this directory.
@ -50,20 +56,20 @@ master_doc = 'index'
# General information about the project.
project = u'envoy'
copyright = u'2016-2017, Lyft'
author = u'Lyft'
copyright = u'2016-2017, Envoy Project Authors'
author = u'Envoy Project Authors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
repo = git.Repo('../../')
last_commit = str(repo.head.commit)[:6]
if not os.environ.get('ENVOY_DOCS_VERSION_STRING'):
raise Exception("ENVOY_DOCS_VERSION_STRING env var must be defined")
# The short X.Y version.
version = u'1.5.0-' + last_commit
version = u'1.5.0-' + os.environ['ENVOY_DOCS_VERSION_STRING']
# The full version, including alpha/beta/rc tags.
release = u'1.5.0-' + last_commit
release = u'1.5.0-' + os.environ['ENVOY_DOCS_VERSION_STRING']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -211,83 +217,3 @@ html_static_path = ['_static']
# Output file base name for HTML help builder.
htmlhelp_basename = 'envoydoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'envoy.tex', u'envoy Documentation',
u'Lyft', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'envoy', u'envoy Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'envoy', u'envoy Documentation',
author, 'envoy', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

@ -1,6 +1,15 @@
Envoy documentation
=================================
.. ifconfig:: release_level in ('pre-release')
.. attention::
This is pre-release documentation generated directly from
`data-plane-api <https://github.com/envoyproxy/data-plane-api>`_. There is risk of it not
being consistent with what is currently implemented in Envoy, though we try to make things
consistent as quickly as possible.
.. toctree::
:maxdepth: 2

Loading…
Cancel
Save