root: fix compose generation for patch releases release candidates (cherry-pick #21353 to version-2025.12) (#21354)

Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
fix compose generation for patch releases release candidates (#21353)
This commit is contained in:
authentik-automation[bot]
2026-04-02 19:12:09 +02:00
committed by GitHub
parent c9b1155ec6
commit ac4e4abd8e
+12 -3
View File
@@ -1,12 +1,21 @@
#!/usr/bin/env python3
from packaging.version import parse
from yaml import safe_dump
from authentik import authentik_version
authentik_image = (
f"${{AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}}:${{AUTHENTIK_TAG:-{authentik_version()}}}"
)
version = authentik_version()
version_parsed = parse(version)
version_split = version_parsed.base_version.split(".")
# If this is an rc version for a patch release (i.e. 2026.2.2-rc1), then don't include that in the
# compose, and fallback to the previous released patch version
if version_parsed.is_prerelease and version_split[-1] != "0":
previous_patch = int(version_split[-1]) - 1
version_split[-1] = str(previous_patch)
version = ".".join(version_split)
authentik_image = f"${{AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}}:${{AUTHENTIK_TAG:-{version}}}"
base = {
"services": {