From 2eb17a1419ca5dd9c682b430e0091a352fd2c414 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 27 Aug 2023 18:33:27 +0200 Subject: [PATCH] docker: show version via $COMMIT_SHA (and $BRANCH if not "main") --- Dockerfile | 3 +++ docker-entrypoint.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index df20609..82bb263 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,6 +70,9 @@ LABEL org.opencontainers.image.title="free-games-claimer" \ org.opencontainers.image.base.name="ubuntu:jammy" \ org.opencontainers.image.version="latest" +ENV COMMIT_SHA=${COMMIT_SHA} +ENV BRANCH=${BRANCH} + # Configure VNC via environment variables: ENV VNC_PORT 5900 ENV NOVNC_PORT 6080 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7796364..cfdac7e 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,6 +2,9 @@ set -eo pipefail # exit on error, error on any fail in pipe (not just last cmd); add -x to print each cmd; see gist bash_strict_mode.md +echo "Version: https://github.com/vogler/free-games-claimer/tree/${COMMIT_SHA}" +[ ! -z $BRANCH ] && [ $BRANCH != "main" ] && echo "Branch: ${BRANCH}" + # Remove chromium profile lock. # When running in docker and then killing it, on the next run chromium displayed a dialog to unlock the profile which made the script time out. # Maybe due to changed hostname of container or due to how the docker container kills playwright - didn't check.