146 lines
3.1 KiB
YAML
146 lines
3.1 KiB
YAML
---
|
|
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
|
|
name: authelia_check
|
|
|
|
trigger:
|
|
event:
|
|
- pull_request
|
|
- push
|
|
|
|
steps:
|
|
- name: ssh-check
|
|
image: appleboy/drone-ssh
|
|
# Hier mappen wir den UI-Parameter 'args' fest auf eine Variable 'MY_ARGS'
|
|
environment:
|
|
MY_ARGS:
|
|
from_env: args
|
|
settings:
|
|
host: 10.0.4.18
|
|
username: root
|
|
password:
|
|
from_secret: password_authelia
|
|
port: 22
|
|
command_timeout: 10m
|
|
# Wir sagen dem Plugin, es soll MY_ARGS mit über SSH nehmen
|
|
envs:
|
|
- MY_ARGS
|
|
- DRONE_BUILD_EVENT
|
|
script: |
|
|
# Einfache Zuweisung ohne komplexe Syntax, um 'sh' Fehler zu vermeiden
|
|
echo "[INFO] Build event: $DRONE_BUILD_EVENT"
|
|
echo "[INFO] Inhalt von MY_ARGS: $MY_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
|
|
|
|
# Skript mit dem Parameter aus MY_ARGS ausführen
|
|
timeout 10m /tmp/authelia-update.sh $MY_ARGS
|
|
|
|
---
|
|
kind: pipeline
|
|
name: authelia_apply
|
|
|
|
trigger:
|
|
event:
|
|
- custom
|
|
|
|
steps:
|
|
- name: ssh-check
|
|
image: appleboy/drone-ssh
|
|
# Hier mappen wir den UI-Parameter 'args' fest auf eine Variable 'MY_ARGS'
|
|
environment:
|
|
MY_ARGS:
|
|
from_env: args
|
|
settings:
|
|
host: 10.0.4.18
|
|
username: root
|
|
password:
|
|
from_secret: password_authelia
|
|
port: 22
|
|
command_timeout: 10m
|
|
# Wir sagen dem Plugin, es soll MY_ARGS mit über SSH nehmen
|
|
envs:
|
|
- MY_ARGS
|
|
- DRONE_BUILD_EVENT
|
|
script: |
|
|
# Einfache Zuweisung ohne komplexe Syntax, um 'sh' Fehler zu vermeiden
|
|
echo "[INFO] Build event: $DRONE_BUILD_EVENT"
|
|
echo "[INFO] Inhalt von MY_ARGS: $MY_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
|
|
|
|
# Skript mit dem Parameter aus MY_ARGS ausführen
|
|
timeout 10m /tmp/authelia-update.sh $MY_ARGS
|
|
|
|
---
|
|
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
|
|
|