Fetch Git commit (and tag, if exists), with its date
This commit is contained in:
parent
547f4a048e
commit
f1ca92d846
|
@ -78,6 +78,7 @@ TEMPLATES = [
|
|||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
"ultron.core.context_processors.git_describe"
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<h4 class=""><i class="icon-primary fal fa-laugh-wink"></i> Hi {{ user.username }} !</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
Welcome to Ultron v0.42 <span class="text-muted">(last update : 9-1-2022)</span><br />
|
||||
Welcome to Ultron {{ git_describe }} <span class="text-muted">(last update : {{ git_date }})</span><br />
|
||||
This application is there to help us manage the gymnasts (evolution, evaluation, routine, scores, ...). It is not perfect so feel free to make improvement proposals, bug reports, … by sending me an <a href="mailto:gregory@flyingacrobaticstrampoline.be">email</a>.<br/>
|
||||
<br/>
|
||||
<span class="text-danger"><b>Gelukkig nieuwjaar 2022 en mijn beste wensen!</b></span>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import subprocess
|
||||
|
||||
|
||||
def git_describe(request) -> str:
|
||||
return {
|
||||
"git_describe": subprocess.check_output(
|
||||
["git", "describe", "--always"]
|
||||
).decode(),
|
||||
"git_date": subprocess.check_output(
|
||||
["git", "show", "-s", r"--format=%cd", r"--date=format:%d-%m-%Y"]
|
||||
).decode(),
|
||||
}
|
Loading…
Reference in New Issue