From 7790bdb4923d8fe5f1e51635add27dd9424c7af4 Mon Sep 17 00:00:00 2001 From: pi-farm Date: Fri, 13 Feb 2026 02:13:20 +0100 Subject: [PATCH] fix docker-compose.yml generation --- .gitea/workflows/build-and-push.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml index b4b8857..983845f 100644 --- a/.gitea/workflows/build-and-push.yaml +++ b/.gitea/workflows/build-and-push.yaml @@ -210,7 +210,6 @@ jobs: done - name: Update Documentation and Compose - # Dieser Step läuft, wenn gebaut wurde ODER wenn manuell gepusht wurde (für Env-Änderungen) if: steps.check_changes.outputs.should_build == 'true' || gitea.event_name == 'push' run: | set -x # <--- AKTIVIERT DAS TRACING @@ -318,6 +317,7 @@ jobs: if [ -f "$template" ]; then > "$output" while IFS= read -r line || [ -n "$line" ]; do + # 1. Standard Ersetzungen (String Replace) line="${line//__REPO_NAME__/$REPO_PURE}" line="${line//__FULL_URL__/$FULL_URL}" line="${line//__BUILD_TAG__/$BUILD_TAG}" @@ -325,9 +325,19 @@ jobs: line="${line//__ARM_STATUS__/$ARM_STATUS}" line="${line//__CURRENT_DATE__/$CURRENT_TIME}" line="${line//__HISTORY_CONTENT__/$HISTORY_CONTENT}" - line="${line//__DOCKER_RUN__/$DOCKER_RUN_FINAL}" # <--- NEU - - echo "$line" >> "$output" + line="${line//__DOCKER_RUN__/$DOCKER_RUN_FINAL}" + + # 2. Block Injection (Das fehlte!) + if [[ "$line" == *"__ENV_BLOCK__"* ]]; then + [ -n "$ENV_BLOCK_CONTENT" ] && echo -e "${ENV_BLOCK_CONTENT}" >> "$output" + elif [[ "$line" == *"__PORTS_BLOCK__"* ]]; then + [ -n "$PORTS_BLOCK_CONTENT" ] && echo -e "${PORTS_BLOCK_CONTENT}" >> "$output" + elif [[ "$line" == *"__VOL_BLOCK__"* ]]; then + [ -n "$VOL_BLOCK_CONTENT" ] && echo -e "${VOL_BLOCK_CONTENT}" >> "$output" + else + # Wenn kein Block-Platzhalter, schreibe die normale (ersetzte) Zeile + echo "$line" >> "$output" + fi done < "$template" fi }