Added Commit Hash and Time to confpy

This commit is contained in:
Gode, Sebastian 2024-09-06 07:25:32 +00:00
parent 0cc28b7d0b
commit b8c62735a2
2 changed files with 9 additions and 1 deletions

View File

@ -16,6 +16,8 @@
import os import os
import sys import sys
from git import Repo
from datetime import datetime
extensions = [ extensions = [
'otcdocstheme', 'otcdocstheme',
@ -131,3 +133,8 @@ latex_documents = [
{% endif -%} {% endif -%}
] ]
# Get the Git commit values
repo = Repo(search_parent_directories=True)
commit = repo.head.commit
current_commit_hash = commit.hexsha[:7]
current_commit_time = commit.committed_datetime.strftime('%Y-%m-%d %H:%M')

View File

@ -13,3 +13,4 @@ otc-sphinx-directives>=0.1.0
sphinx-minify>=0.0.1 # Apache-2.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 git+https://gitea.eco.tsi-dev.otc-service.com/infra/otc-metadata.git#egg=otc_metadata
setuptools setuptools
gitpython