From ad0b43cd452c249b6c21dab85f1400571e395eaa Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 16 Feb 2023 19:52:09 +0100 Subject: [PATCH] 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) --- Dockerfile | 3 ++- README.md | 8 +++++++- main.go | 1 + templates/about.html | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a30cefe..e4d5525 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ LABEL maintainer="Khanh Ngo Current version +{{ if .gitCommit }} +
+ + +
+{{ end }}