This commit is contained in:
113
.drone.yml
Normal file
113
.drone.yml
Normal file
@@ -0,0 +1,113 @@
|
||||
---
|
||||
kind: secret
|
||||
name: password_authelia
|
||||
get:
|
||||
path: secret/data/authelia/ssh
|
||||
name: root
|
||||
|
||||
---
|
||||
kind: secret
|
||||
name: password_matrix
|
||||
get:
|
||||
path: secret/data/matrix/bot/drone-bot
|
||||
name: password
|
||||
---
|
||||
kind: secret
|
||||
name: userid_matrix
|
||||
get:
|
||||
path: secret/data/matrix/bot/drone-bot
|
||||
name: userid
|
||||
---
|
||||
kind: secret
|
||||
name: roomid_matrix
|
||||
get:
|
||||
path: secret/data/matrix/bot/drone-bot
|
||||
name: roomid
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: authelia_check
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
- custom
|
||||
- cron
|
||||
|
||||
steps:
|
||||
- name: ssh-check
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host: 10.0.4.18
|
||||
username: root
|
||||
password:
|
||||
from_secret: password_authelia
|
||||
port: 22
|
||||
envs:
|
||||
- args
|
||||
- ARGS
|
||||
- DRONE_BUILD_EVENT
|
||||
script: |
|
||||
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
|
||||
|
||||
set +e
|
||||
timeout 10m /tmp/authelia-update.sh $FINAL_ARGS
|
||||
EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
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 "[INFO] Skript beendet mit: $MSG"
|
||||
|
||||
if [ $EXIT_CODE -ne 0 ] && [ $EXIT_CODE -ne 10 ]; then exit $EXIT_CODE; fi
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: matrix_message
|
||||
|
||||
depends_on:
|
||||
- authelia_check
|
||||
|
||||
trigger:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
|
||||
steps:
|
||||
- name: notify
|
||||
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
|
||||
markdown: 'yes'
|
||||
template: |
|
||||
### Authelia Update Bericht
|
||||
**Status:** ${DRONE_BUILD_STATUS}
|
||||
**Event:** `${DRONE_BUILD_EVENT}`
|
||||
**Build:** [#${DRONE_BUILD_NUMBER}](${DRONE_BUILD_LINK})
|
||||
|
||||
**Details:**
|
||||
Der Build wurde mit dem Status **${DRONE_BUILD_STATUS}** beendet.
|
||||
Bitte prüfe die Logs für Details zum Exit-Code des Skripts.
|
||||
|
||||
[Protokoll einsehen](${DRONE_BUILD_LINK})
|
||||
Reference in New Issue
Block a user