add first bits of jinja template support

This commit is contained in:
Andreas Köpf
2022-12-21 20:17:47 +01:00
parent 55c79b98f1
commit d20828e759
9 changed files with 133 additions and 15 deletions
+17
View File
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
import subprocess
from datetime import datetime
import pytz
def get_git_head_hash():
# get current git hash
x = subprocess.run(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, universal_newlines=True)
if x.returncode == 0:
return x.stdout.replace("\n", "")
return None
def utcnow() -> datetime:
return datetime.now(pytz.UTC)