Implemented new filter for image logic in docker-compose.yml.j2 und env.j2 files

This commit is contained in:
2025-06-18 14:28:06 +02:00
parent ced5e27453
commit 25ba93cbfd
2 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# filter_plugins/docker_image.py
def get_docker_image(applications, application_id, image_key):
app = applications.get(application_id, {})
docker = app.get("docker", {})
images = docker.get("images", {})
versions = docker.get("versions", {})
version = versions.get(image_key) or app.get("version")
image = images.get(image_key)
if not image or not version:
raise ValueError(f"Missing image or version for {application_id}:{image_key}")
return f"{image}:{version}"
class FilterModule(object):
def filters(self):
return {
'get_docker_image': get_docker_image,
}