def render(self, context):
try:
r = Repo(BASE_DIR)
version = r.rev_parse("HEAD").hexsha
context['git'] = {
"shortHexSha": version[0:7],
"hexSha": version,
"shortRemote": "https://github.com",
"remote": "https://github.com/rubienr/network-monitoring"
}
except Exception:
context['git'] = {
"shortHexSha": None,
"hexSha": None,
"shortRemote": None,
"remote": None,
}
return ""
评论列表
文章目录