.drone.yml aktualisiert
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
71
.drone.yml
71
.drone.yml
@@ -50,26 +50,46 @@ steps:
|
||||
- ARGS
|
||||
- DRONE_BUILD_EVENT
|
||||
script: |
|
||||
FINAL_ARGS=${args:-${ARGS:-}}
|
||||
|
||||
echo "[INFO] Event: $DRONE_BUILD_EVENT"
|
||||
echo "[INFO] Parameter erkannt: $FINAL_ARGS"
|
||||
export FINAL_ARGS=${args:-${ARGS:-}}
|
||||
|
||||
fetch -o /tmp/authelia-update.sh https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
|
||||
chmod +x /tmp/authelia-update.sh
|
||||
|
||||
# Wir führen das Script aus und fangen den Exit Code ab
|
||||
set +e
|
||||
timeout 10m /tmp/authelia-update.sh $FINAL_ARGS
|
||||
EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
fetch -o /tmp/authelia-update.sh https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
|
||||
chmod +x /tmp/authelia-update.sh
|
||||
|
||||
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
|
||||
name: matrix_message
|
||||
|
||||
# Diese Pipeline läuft immer nach authelia_apply
|
||||
depends_on:
|
||||
- authelia_check
|
||||
- authelia_apply
|
||||
|
||||
trigger:
|
||||
status:
|
||||
--success
|
||||
- success
|
||||
- failure
|
||||
|
||||
steps:
|
||||
@@ -77,28 +97,17 @@ steps:
|
||||
image: spotlightkid/drone-matrixchat-notify
|
||||
settings:
|
||||
homeserver: 'https://matrix.familie-berner.de'
|
||||
roomid:
|
||||
from_secret: roomid_matrix
|
||||
userid:
|
||||
from_secret: userid_matrix
|
||||
password:
|
||||
from_secret: password_matrix
|
||||
roomid: { from_secret: roomid_matrix }
|
||||
userid: { from_secret: userid_matrix }
|
||||
password: { from_secret: password_matrix }
|
||||
markdown: 'yes'
|
||||
template: |
|
||||
**Authelia Update**
|
||||
repo: `${DRONE_REPO}`
|
||||
branch: `${DRONE_BRANCH}`
|
||||
build: `#${DRONE_BUILD_NUMBER}`
|
||||
status: **${DRONE_BUILD_STATUS}**
|
||||
### Authelia Update Bericht
|
||||
**Status:** ${DRONE_BUILD_STATUS == 'success' ? '✅ Erfolg' : '❌ Fehlgeschlagen'}
|
||||
**Event:** `${DRONE_BUILD_EVENT}`
|
||||
**Build:** [#${DRONE_BUILD_NUMBER}](${DRONE_BUILD_LINK})
|
||||
|
||||
event: `${DRONE_BUILD_EVENT}`
|
||||
commit: ${DRONE_COMMIT_LINK}
|
||||
|
||||
pr: `${DRONE_PULL_REQUEST}`
|
||||
${DRONE_PULL_REQUEST_TITLE}
|
||||
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- main
|
||||
**Details:**
|
||||
${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.'}
|
||||
|
||||
[Protokoll einsehen](${DRONE_BUILD_LINK})
|
||||
Reference in New Issue
Block a user