Stamp git commit into docker builds.

Conditionally include git commit into about page.

The if condition is true when the following docker build arg is included

--build-arg=COMMIT=$(git rev-parse --short HEAD)

or when built via github (release.yml)
This commit is contained in:
Paul 2023-02-16 19:52:09 +01:00
parent aadf099f50
commit ad0b43cd45
4 changed files with 16 additions and 2 deletions

View file

@ -30,6 +30,12 @@ About
<label for="version" class="control-label">Current version</label>
<input type="text" class="form-control" id="version" value="{{ .appVersion }}" readonly>
</div>
{{ if .gitCommit }}
<div class="form-group">
<label for="version" class="control-label">git commit hash</label>
<input type="text" class="form-control" id="version" value="{{ .gitCommit }}" readonly>
</div>
{{ end }}
<div class="form-group">
<label for="currentReleaseDate" class="control-label">Current version release date</label>
<input type="text" class="form-control" id="currentReleaseDate" readonly>