root: fix compose generation for patch releases release candidates (#21353)

* root: fix compose generation for patch releases release candidates

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

* add comment

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

---------

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2026-04-02 16:51:47 +00:00
committed by GitHub
parent 84581a0dbd
commit 111f0c072f

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": {