diff --git a/Dockerfile b/Dockerfile index aef9ef2e..24c2ee2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,7 @@ RUN apk add --no-cache --virtual .build-deps \ python3-dev \ libffi-dev \ build-base \ + git \ && apk add --no-cache \ py3-virtualenv \ py3-pillow \ diff --git a/mautrix_telegram/get_version.py b/mautrix_telegram/get_version.py index 109a88be..e90a1c9f 100644 --- a/mautrix_telegram/get_version.py +++ b/mautrix_telegram/get_version.py @@ -15,12 +15,7 @@ cmd_env = { def run(cmd): return subprocess.check_output(cmd, stderr=subprocess.DEVNULL, env=cmd_env) -if os.environ.get("CI_SERVER", "no") == "yes": - git_revision = os.environ["CI_COMMIT_SHA"] - git_revision_url = f"https://github.com/tulir/mautrix-telegram/commit/{git_revision}" - git_revision = git_revision[:8] - git_tag = os.environ.get("CI_COMMIT_TAG", None) -elif os.path.exists(".git") and shutil.which("git"): +if os.path.exists(".git") and shutil.which("git"): try: git_revision = run(["git", "rev-parse", "HEAD"]).strip().decode("ascii") git_revision_url = f"https://github.com/tulir/mautrix-telegram/commit/{git_revision}"