fix README.md generation
This commit is contained in:
1 parent
17ce5365be
commit
0a9636ebe1
1 file changed
+14
-4
@@ -365,15 +365,25 @@ jobs:
|
||||
with open(readme_template, "r", encoding="utf-8") as f:
|
||||
rm_content = f.read()
|
||||
|
||||
# Hole die Beschreibung aus den Umgebungsvariablen (aus buildargs.env)
|
||||
description = os.environ.get("DESCRIPTION", "Docker Image for samba-ad-dc")
|
||||
current_date = os.environ.get("CURRENT_TIME", "07.06.2026") # oder aktuelles Datum
|
||||
|
||||
# Platzhalter in der README ersetzen
|
||||
# Docker Compose Inhalt einlesen
|
||||
compose_content = open("docker-compose.yml", "r", encoding="utf-8").read() if os.path.exists("docker-compose.yml") else ""
|
||||
docker_run_content = open("docker_run_block.txt", "r", encoding="utf-8").read() if os.path.exists("docker_run_block.txt") else ""
|
||||
|
||||
# Alle Platzhalter in der README ersetzen
|
||||
rm_content = rm_content.replace("__REPO_NAME__", "samba-ad-dc")
|
||||
rm_content = rm_content.replace("__BUILD_TAG__", os.environ.get("FINAL_TAG", "trixie"))
|
||||
rm_content = rm_content.replace("__FULL_URL__", "git.pi-farm.de/pi-farm/samba-ad-dc")
|
||||
rm_content = rm_content.replace("__DESCRIPTION__", description)
|
||||
rm_content = rm_content.replace("__HISTORY_TABLE__", os.environ.get("HISTORY_CONTENT", ""))
|
||||
rm_content = rm_content.replace("__DOCKER_RUN_BLOCK__", open("docker_run_block.txt", "r").read() if os.path.exists("docker_run_block.txt") else "")
|
||||
rm_content = rm_content.replace("__BASE_IMAGE__", os.environ.get("BASE_IMAGE", "debian:trixie-slim"))
|
||||
rm_content = rm_content.replace("__ARM_STATUS__", "✅ Active" if os.path.exists("Dockerfile.aarch64") else "❌ Not supported")
|
||||
rm_content = rm_content.replace("__COMPOSE_BLOCK__", compose_content)
|
||||
rm_content = rm_content.replace("__DOCKER_RUN__", docker_run_content)
|
||||
rm_content = rm_content.replace("__DOCKERHUB_LINK__", os.environ.get("DOCKERHUB_LINK_CONTENT", ""))
|
||||
rm_content = rm_content.replace("__CURRENT_DATE__", os.environ.get("CURRENT_TIME", ""))
|
||||
rm_content = rm_content.replace("__HISTORY_CONTENT__", os.environ.get("HISTORY_CONTENT", ""))
|
||||
|
||||
with open("README.md", "w", encoding="utf-8") as f:
|
||||
f.write(rm_content)
|
||||
|
||||
Reference in new issue
Block a user