add Description and Docker Compose Block to Readme.md
Some checks failed
/ release-and-build (push) Failing after 18s
Some checks failed
/ release-and-build (push) Failing after 18s
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user