From d5cb7e36df16cfdd7ed5bdcd2908a60597d285bf Mon Sep 17 00:00:00 2001 From: pi-farm Date: Fri, 13 Feb 2026 17:50:22 +0100 Subject: [PATCH] add Description and Docker Compose Block to Readme.md --- .gitea/workflows/build-and-push.yaml | 16 +++++++++++++--- buildargs.env | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml index 9a21131..b2645bf 100644 --- a/.gitea/workflows/build-and-push.yaml +++ b/.gitea/workflows/build-and-push.yaml @@ -311,7 +311,7 @@ jobs: RUN_CMD="${RUN_CMD} \\ \n ${FULL_URL}:${BUILD_TAG}" DOCKER_RUN_FINAL=$(echo -e "$RUN_CMD") - # TEMPLATE ENGINE + # --- TEMPLATE ENGINE (KORRIGIERT & ERWEITERT) --- process_template() { local template=$1; local output=$2 if [ -f "$template" ]; then @@ -326,8 +326,11 @@ jobs: line="${line//__CURRENT_DATE__/$CURRENT_TIME}" line="${line//__HISTORY_CONTENT__/$HISTORY_CONTENT}" line="${line//__DOCKER_RUN__/$DOCKER_RUN_FINAL}" + + # NEU: Description (mit Fallback, falls die Variable mal fehlt) + line="${line//__DESCRIPTION__/${DESCRIPTION:-Keine Beschreibung angegeben.}}" - # 2. Block Injection (Jetzt sicher gegen Abstürze bei leeren Variablen) + # 2. Block Injection if [[ "$line" == *"__ENV_BLOCK__"* ]]; then if [ -n "$ENV_BLOCK_CONTENT" ]; then echo -e "${ENV_BLOCK_CONTENT}" >> "$output" @@ -340,6 +343,11 @@ jobs: if [ -n "$VOL_BLOCK_CONTENT" ]; then echo -e "${VOL_BLOCK_CONTENT}" >> "$output" fi + # NEU: Compose Block Injection + elif [[ "$line" == *"__COMPOSE_BLOCK__"* ]]; then + if [ -f "docker-compose.yml" ]; then + cat docker-compose.yml >> "$output" + fi else # Wenn kein Block-Platzhalter, schreibe die normale Zeile echo "$line" >> "$output" @@ -348,8 +356,10 @@ jobs: fi } - process_template "README.template" "README.md" + # WICHTIG: Zuerst Compose generieren, dann README! + # Nur so können wir die fertige Compose-Datei in die README einfügen. process_template "docker-compose.template" "docker-compose.yml" + process_template "README.template" "README.md" echo "FINAL_MSG=$COMMIT_MSG" >> $GITHUB_ENV diff --git a/buildargs.env b/buildargs.env index 8e8e9db..7a66c40 100644 --- a/buildargs.env +++ b/buildargs.env @@ -18,4 +18,5 @@ ENV_PUID=1000 ENV_PGID=1000 # VOL_CONFIG=./config:/config # VOL_DATA=./data:/data -# PORT_WEB=8080:80 \ No newline at end of file +# PORT_WEB=8080:80 +DESCRIPTION="Dies ist ein Alpine-basiertes Base-Image für meine Pi-Farm."