.drone.yml aktualisiert
This commit is contained in:
59
.drone.yml
59
.drone.yml
@@ -37,6 +37,10 @@ trigger:
|
|||||||
steps:
|
steps:
|
||||||
- name: ssh-check
|
- name: ssh-check
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
|
# Hier mappen wir den UI-Parameter 'args' fest auf eine Variable 'MY_ARGS'
|
||||||
|
environment:
|
||||||
|
MY_ARGS:
|
||||||
|
from_env: args
|
||||||
settings:
|
settings:
|
||||||
host: 10.0.4.18
|
host: 10.0.4.18
|
||||||
username: root
|
username: root
|
||||||
@@ -44,32 +48,21 @@ steps:
|
|||||||
from_secret: password_authelia
|
from_secret: password_authelia
|
||||||
port: 22
|
port: 22
|
||||||
command_timeout: 10m
|
command_timeout: 10m
|
||||||
# Wir mappen die Variable 'args' explizit aus der Umgebung
|
# Wir sagen dem Plugin, es soll MY_ARGS mit über SSH nehmen
|
||||||
# Drone stellt manuelle Parameter als kleingeschriebene env-Variablen bereit
|
|
||||||
envs:
|
envs:
|
||||||
- args
|
- MY_ARGS
|
||||||
- DRONE_BUILD_EVENT
|
- DRONE_BUILD_EVENT
|
||||||
script: |
|
script: |
|
||||||
# Wir weisen den Wert einer lokalen Variable zu, um sicherzugehen
|
# Einfache Zuweisung ohne komplexe Syntax, um 'sh' Fehler zu vermeiden
|
||||||
# Falls 'args' klein geschrieben nicht geht, testen wir ARGS
|
echo "[INFO] Build event: $DRONE_BUILD_EVENT"
|
||||||
INPUT_ARGS="${args:-${ARGS:-}}"
|
echo "[INFO] Inhalt von MY_ARGS: $MY_ARGS"
|
||||||
|
|
||||||
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
|
||||||
|
|
||||||
# Debug: Zeige alle Umgebungsvariablen, die mit A oder a beginnen (optional)
|
|
||||||
# env | grep -E '^(args|ARGS|DRONE)'
|
|
||||||
|
|
||||||
if [ -z "$INPUT_ARGS" ]; then
|
|
||||||
echo "[INFO] Extracted Args: Keine Parameter empfangen"
|
|
||||||
else
|
|
||||||
echo "[INFO] Extracted Args: $INPUT_ARGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fetch -o /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
|
https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
|
||||||
chmod +x /tmp/authelia-update.sh
|
chmod +x /tmp/authelia-update.sh
|
||||||
|
|
||||||
timeout 10m /tmp/authelia-update.sh $INPUT_ARGS
|
# Skript mit dem Parameter aus MY_ARGS ausführen
|
||||||
|
timeout 10m /tmp/authelia-update.sh $MY_ARGS
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@@ -77,12 +70,15 @@ name: authelia_apply
|
|||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- cron
|
|
||||||
- custom
|
- custom
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ssh-check
|
- name: ssh-check
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
|
# Hier mappen wir den UI-Parameter 'args' fest auf eine Variable 'MY_ARGS'
|
||||||
|
environment:
|
||||||
|
MY_ARGS:
|
||||||
|
from_env: args
|
||||||
settings:
|
settings:
|
||||||
host: 10.0.4.18
|
host: 10.0.4.18
|
||||||
username: root
|
username: root
|
||||||
@@ -90,32 +86,21 @@ steps:
|
|||||||
from_secret: password_authelia
|
from_secret: password_authelia
|
||||||
port: 22
|
port: 22
|
||||||
command_timeout: 10m
|
command_timeout: 10m
|
||||||
# Wir mappen die Variable 'args' explizit aus der Umgebung
|
# Wir sagen dem Plugin, es soll MY_ARGS mit über SSH nehmen
|
||||||
# Drone stellt manuelle Parameter als kleingeschriebene env-Variablen bereit
|
|
||||||
envs:
|
envs:
|
||||||
- args
|
- MY_ARGS
|
||||||
- DRONE_BUILD_EVENT
|
- DRONE_BUILD_EVENT
|
||||||
script: |
|
script: |
|
||||||
# Wir weisen den Wert einer lokalen Variable zu, um sicherzugehen
|
# Einfache Zuweisung ohne komplexe Syntax, um 'sh' Fehler zu vermeiden
|
||||||
# Falls 'args' klein geschrieben nicht geht, testen wir ARGS
|
echo "[INFO] Build event: $DRONE_BUILD_EVENT"
|
||||||
INPUT_ARGS="${args:-${ARGS:-}}"
|
echo "[INFO] Inhalt von MY_ARGS: $MY_ARGS"
|
||||||
|
|
||||||
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
|
||||||
|
|
||||||
# Debug: Zeige alle Umgebungsvariablen, die mit A oder a beginnen (optional)
|
|
||||||
# env | grep -E '^(args|ARGS|DRONE)'
|
|
||||||
|
|
||||||
if [ -z "$INPUT_ARGS" ]; then
|
|
||||||
echo "[INFO] Extracted Args: Keine Parameter empfangen"
|
|
||||||
else
|
|
||||||
echo "[INFO] Extracted Args: $INPUT_ARGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fetch -o /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
|
https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
|
||||||
chmod +x /tmp/authelia-update.sh
|
chmod +x /tmp/authelia-update.sh
|
||||||
|
|
||||||
timeout 10m /tmp/authelia-update.sh $INPUT_ARGS
|
# Skript mit dem Parameter aus MY_ARGS ausführen
|
||||||
|
timeout 10m /tmp/authelia-update.sh $MY_ARGS
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
|||||||
Reference in New Issue
Block a user