Files
infra-maintenance/.drone.yml
T

159 lines
3.4 KiB
YAML
Raw Normal View History

2026-01-10 12:34:31 +01:00
---
kind: secret
2026-01-10 21:31:22 +01:00
name: password_authelia
2026-01-10 12:34:31 +01:00
get:
2026-01-10 21:31:22 +01:00
path: secret/data/authelia/ssh
name: root
2026-01-10 12:34:31 +01:00
---
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
2026-01-10 19:24:46 +01:00
---
kind: pipeline
2026-01-10 22:22:33 +01:00
name: authelia_check
2026-01-10 19:24:46 +01:00
2026-01-10 22:11:16 +01:00
trigger:
event:
- pull_request
2026-01-10 22:13:51 +01:00
- push
2026-01-10 22:11:16 +01:00
2026-01-10 19:24:46 +01:00
steps:
- name: ssh-check
image: appleboy/drone-ssh
settings:
2026-01-10 21:31:22 +01:00
host: 10.0.4.18
username: root
2026-01-10 19:24:46 +01:00
password:
2026-01-10 21:31:22 +01:00
from_secret: password_authelia
2026-01-10 19:24:46 +01:00
port: 22
2026-01-10 22:06:56 +01:00
command_timeout: 10m
2026-01-11 10:36:57 +01:00
envs:
- DRONE_BUILD_PARAMS
- DRONE_BUILD_EVENT
2026-01-10 22:06:56 +01:00
script: |
2026-01-11 10:25:44 +01:00
set -eu
2026-01-11 10:36:57 +01:00
# Drone übergibt Build-Parameter als JSON-String in DRONE_BUILD_PARAMS
# Beispiel: {"args": "mein-wert"}
2026-01-11 10:25:44 +01:00
ARGS=""
if [ -n "${DRONE_BUILD_PARAMS:-}" ]; then
2026-01-11 10:36:57 +01:00
# Extrahiere den Wert für den Key "args"
2026-01-11 10:25:44 +01:00
ARGS=$(echo "$DRONE_BUILD_PARAMS" | sed -n 's/.*"args"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
fi
2026-01-10 19:24:46 +01:00
2026-01-10 22:06:56 +01:00
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
2026-01-11 10:25:44 +01:00
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
2026-01-11 10:36:57 +01:00
echo "[INFO] Raw Params: ${DRONE_BUILD_PARAMS:-none}"
echo "[INFO] Extracted Args: ${ARGS:-<none>}"
2026-01-11 10:25:44 +01:00
timeout 10m /tmp/authelia-update.sh $ARGS
2026-01-10 18:41:36 +01:00
2026-01-10 12:34:31 +01:00
---
kind: pipeline
name: authelia_apply
2026-01-10 22:11:16 +01:00
trigger:
event:
2026-01-10 22:15:56 +01:00
- cron
2026-01-10 22:36:23 +01:00
- custom
2026-01-11 10:36:57 +01:00
2026-01-10 12:34:31 +01:00
steps:
2026-01-10 23:13:49 +01:00
- name: ssh-check
2026-01-10 22:06:56 +01:00
image: appleboy/drone-ssh
settings:
host: 10.0.4.18
username: root
password:
from_secret: password_authelia
port: 22
2026-01-10 23:13:49 +01:00
command_timeout: 10m
2026-01-10 23:36:42 +01:00
envs:
2026-01-11 10:36:57 +01:00
- DRONE_BUILD_PARAMS
2026-01-10 23:36:42 +01:00
- DRONE_BUILD_EVENT
2026-01-10 23:18:25 +01:00
script: |
2026-01-10 23:36:42 +01:00
set -eu
2026-01-11 10:36:57 +01:00
# Drone übergibt Build-Parameter als JSON-String in DRONE_BUILD_PARAMS
# Beispiel: {"args": "mein-wert"}
2026-01-11 10:25:44 +01:00
ARGS=""
if [ -n "${DRONE_BUILD_PARAMS:-}" ]; then
2026-01-11 10:36:57 +01:00
# Extrahiere den Wert für den Key "args"
2026-01-11 10:25:44 +01:00
ARGS=$(echo "$DRONE_BUILD_PARAMS" | sed -n 's/.*"args"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
fi
2026-01-10 23:18:25 +01:00
fetch -o /tmp/authelia-update.sh \
2026-01-10 23:36:42 +01:00
https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
chmod +x /tmp/authelia-update.sh
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
2026-01-11 10:36:57 +01:00
echo "[INFO] Raw Params: ${DRONE_BUILD_PARAMS:-none}"
echo "[INFO] Extracted Args: ${ARGS:-<none>}"
2026-01-10 23:36:42 +01:00
2026-01-11 10:25:44 +01:00
timeout 10m /tmp/authelia-update.sh $ARGS
2026-01-10 18:41:36 +01:00
2026-01-10 12:34:31 +01:00
---
kind: pipeline
name: matrix_message
depends_on:
- authelia_check
trigger:
status:
- 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**
repo: `${DRONE_REPO}`
branch: `${DRONE_BRANCH}`
build: `#${DRONE_BUILD_NUMBER}`
status: **${DRONE_BUILD_STATUS}**
event: `${DRONE_BUILD_EVENT}`
commit: ${DRONE_COMMIT_LINK}
pr: `${DRONE_PULL_REQUEST}`
${DRONE_PULL_REQUEST_TITLE}
when:
branch:
- master
- main
2026-01-10 18:46:49 +01:00