]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/conf: read version and release from src/ceph_release
authorKefu Chai <kchai@redhat.com>
Tue, 1 Dec 2020 06:46:19 +0000 (14:46 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 1 Dec 2020 07:41:45 +0000 (15:41 +0800)
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>
doc/conf.py

index dc26d63e82ef8f45dbe7aa61145265fc9be4287b..9fb5479ba01d4729b6851a1afdbf1d9998927499 100644 (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