.drone.yml aktualisiert
Some checks failed
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2026-01-11 14:27:46 +01:00
parent eced361e48
commit f13bf98102

View File

@@ -50,26 +50,46 @@ steps:
- ARGS - ARGS
- DRONE_BUILD_EVENT - DRONE_BUILD_EVENT
script: | script: |
FINAL_ARGS=${args:-${ARGS:-}} export FINAL_ARGS=${args:-${ARGS:-}}
echo "[INFO] Event: $DRONE_BUILD_EVENT" fetch -o /tmp/authelia-update.sh https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
echo "[INFO] Parameter erkannt: $FINAL_ARGS" chmod +x /tmp/authelia-update.sh
fetch -o /tmp/authelia-update.sh https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh # Wir führen das Script aus und fangen den Exit Code ab
chmod +x /tmp/authelia-update.sh set +e
timeout 10m /tmp/authelia-update.sh $FINAL_ARGS
EXIT_CODE=$?
set -e
timeout 10m /tmp/authelia-update.sh $FINAL_ARGS # Übersetze Exit-Codes in lesbaren Text für Matrix
case $EXIT_CODE in
0) MSG="✅ Update erfolgreich / Alles aktuell" ;;
10) MSG=" Update verfügbar, aber nicht angewendet (--apply fehlt)" ;;
64) MSG="❌ Fehler: Ungültige Parameter" ;;
69) MSG="🌐 Fehler: Netzwerk/GitHub nicht erreichbar" ;;
70) MSG="📂 Fehler: Authelia Binary nicht gefunden" ;;
72) MSG="↩ Fehler: Kein Backup für Revert gefunden" ;;
75) MSG="🔥 KRITISCH: Dienst startet nicht! (Auto-Revert ggf. aktiv)" ;;
*) MSG="❓ Unbekannter Fehler (Code: $EXIT_CODE)" ;;
esac
echo "STATUS_TEXT=$MSG" > /tmp/drone_result.env
echo "[INFO] Skript beendet mit: $MSG"
# Wir lassen den Step fehlschlagen, wenn Code nicht 0 oder 10 ist
if [ $EXIT_CODE -ne 0 ] && [ $EXIT_CODE -ne 10 ]; then exit $EXIT_CODE; fi
--- ---
kind: pipeline kind: pipeline
name: matrix_message name: matrix_message
# Diese Pipeline läuft immer nach authelia_apply
depends_on: depends_on:
- authelia_check - authelia_apply
trigger: trigger:
status: status:
--success - success
- failure - failure
steps: steps:
@@ -77,28 +97,17 @@ steps:
image: spotlightkid/drone-matrixchat-notify image: spotlightkid/drone-matrixchat-notify
settings: settings:
homeserver: 'https://matrix.familie-berner.de' homeserver: 'https://matrix.familie-berner.de'
roomid: roomid: { from_secret: roomid_matrix }
from_secret: roomid_matrix userid: { from_secret: userid_matrix }
userid: password: { from_secret: password_matrix }
from_secret: userid_matrix
password:
from_secret: password_matrix
markdown: 'yes' markdown: 'yes'
template: | template: |
**Authelia Update** ### Authelia Update Bericht
repo: `${DRONE_REPO}` **Status:** ${DRONE_BUILD_STATUS == 'success' ? '✅ Erfolg' : '❌ Fehlgeschlagen'}
branch: `${DRONE_BRANCH}` **Event:** `${DRONE_BUILD_EVENT}`
build: `#${DRONE_BUILD_NUMBER}` **Build:** [#${DRONE_BUILD_NUMBER}](${DRONE_BUILD_LINK})
status: **${DRONE_BUILD_STATUS}**
event: `${DRONE_BUILD_EVENT}` **Details:**
commit: ${DRONE_COMMIT_LINK} ${DRONE_BUILD_STATUS == 'success' ? 'Das Skript wurde erfolgreich ausgeführt oder es war kein Update nötig.' : 'Ein Fehler ist aufgetreten. Bitte prüfe die Drone-Logs für den Exit-Code.'}
pr: `${DRONE_PULL_REQUEST}`
${DRONE_PULL_REQUEST_TITLE}
when:
branch:
- master
- main
[Protokoll einsehen](${DRONE_BUILD_LINK})