doc/conf: read version and release from src/ceph_release

instead of hardwiring them to 'dev' and 'dev', use the src/ceph_release
as the source of truth.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-12-01 14:46:19 +08:00
parent be26c566e5
commit beb218c41d

View File

@ -7,13 +7,28 @@ import sys
import yaml
top_level = \
os.path.dirname(
os.path.dirname(
os.path.abspath(__file__)))
def parse_ceph_release():
with open(os.path.join(top_level, 'src/ceph_release')) as f:
lines = f.readlines()
assert(len(lines) == 3)
# 16, pacific, dev
version, codename, status = [line.strip() for line in lines]
return version, codename, status
# project information
project = 'Ceph'
copyright = ('2016, Ceph authors and contributors. '
'Licensed under Creative Commons Attribution Share Alike 3.0 '
'(CC-BY-SA-3.0)')
version = 'dev'
release = 'dev'
version, codename, release = parse_ceph_release()
pygments_style = 'sphinx'
# HTML output options
@ -104,12 +119,6 @@ rst_prolog = """
.. |stable-release| replace:: octopus
"""
top_level = os.path.dirname(
os.path.dirname(
os.path.abspath(__file__)
)
)
# breath options
breathe_default_project = "Ceph"
# see $(top_srcdir)/Doxyfile