diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index c08cdaf..4d19ffc 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -16,6 +16,8 @@ import os import sys +from git import Repo +from datetime import datetime extensions = [ 'otcdocstheme', @@ -115,3 +117,9 @@ latex_documents = [ u'Cloud Firewall - API Reference', u'OpenTelekomCloud', 'manual'), ] + +# Get the Git commit values for last updated timestamp on each page +repo = Repo(search_parent_directories=True) +commit = repo.head.commit +current_commit_hash = commit.hexsha +current_commit_time = commit.committed_datetime.strftime('%Y-%m-%d %H:%M') \ No newline at end of file diff --git a/doc/requirements.txt b/doc/requirements.txt index 492834a..5723799 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -8,4 +8,5 @@ reno>=3.1.0 # Apache-2.0 otc-sphinx-directives>=0.1.0 sphinx-minify>=0.0.1 # Apache-2.0 git+https://gitea.eco.tsi-dev.otc-service.com/infra/otc-metadata.git#egg=otc_metadata -setuptools \ No newline at end of file +setuptools +gitpython \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 6dbcdb3..5eed927 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -16,6 +16,8 @@ import os import sys +from git import Repo +from datetime import datetime extensions = [ 'otcdocstheme', @@ -111,3 +113,9 @@ html_copy_source = False # -- Options for PDF output -------------------------------------------------- latex_documents = [] + +# Get the Git commit values for last updated timestamp on each page +repo = Repo(search_parent_directories=True) +commit = repo.head.commit +current_commit_hash = commit.hexsha +current_commit_time = commit.committed_datetime.strftime('%Y-%m-%d %H:%M') \ No newline at end of file diff --git a/umn/source/conf.py b/umn/source/conf.py index a722069..9e1204b 100644 --- a/umn/source/conf.py +++ b/umn/source/conf.py @@ -16,6 +16,8 @@ import os import sys +from git import Repo +from datetime import datetime extensions = [ 'otcdocstheme', @@ -115,3 +117,9 @@ latex_documents = [ u'Cloud Firewall - User Guide', u'OpenTelekomCloud', 'manual'), ] + +# Get the Git commit values for last updated timestamp on each page +repo = Repo(search_parent_directories=True) +commit = repo.head.commit +current_commit_hash = commit.hexsha +current_commit_time = commit.committed_datetime.strftime('%Y-%m-%d %H:%M') \ No newline at end of file diff --git a/zuul.yaml b/zuul.yaml index a4d00bd..107ef29 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -1,3 +1,4 @@ +--- - project: merge-mode: squash-merge default-branch: main @@ -8,4 +9,4 @@ - noop gate: jobs: - - noop + - noop \ No newline at end of file