.drone.yml aktualisiert
This commit is contained in:
+14
-24
@@ -44,20 +44,15 @@ steps:
|
||||
from_secret: password_authelia
|
||||
port: 22
|
||||
command_timeout: 10m
|
||||
# WICHTIG: Hier muss der Name deines Keys in GROSSBUCHSTABEN stehen
|
||||
envs:
|
||||
- DRONE_BUILD_PARAMS
|
||||
- ARGS
|
||||
- DRONE_BUILD_EVENT
|
||||
script: |
|
||||
set -eu
|
||||
|
||||
# Drone übergibt Build-Parameter als JSON-String in DRONE_BUILD_PARAMS
|
||||
# Beispiel: {"args": "mein-wert"}
|
||||
|
||||
ARGS=""
|
||||
if [ -n "${DRONE_BUILD_PARAMS:-}" ]; then
|
||||
# Extrahiere den Wert für den Key "args"
|
||||
ARGS=$(echo "$DRONE_BUILD_PARAMS" | sed -n 's/.*"args"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
|
||||
fi
|
||||
# Jetzt kannst du direkt auf $ARGS zugreifen,
|
||||
# da Drone den Key 'args' als Umgebungsvariable exportiert.
|
||||
|
||||
fetch -o /tmp/authelia-update.sh \
|
||||
https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
|
||||
@@ -65,10 +60,10 @@ steps:
|
||||
chmod +x /tmp/authelia-update.sh
|
||||
|
||||
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
||||
echo "[INFO] Raw Params: ${DRONE_BUILD_PARAMS:-none}"
|
||||
echo "[INFO] Extracted Args: ${ARGS:-<none>}"
|
||||
echo "[INFO] Extracted Args: ${ARGS:-keine Parameter übergeben}"
|
||||
|
||||
timeout 10m /tmp/authelia-update.sh $ARGS
|
||||
# Ausführen mit dem Wert aus der UI (z.B. --apply)
|
||||
timeout 10m /tmp/authelia-update.sh ${ARGS:-}
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@@ -89,20 +84,15 @@ steps:
|
||||
from_secret: password_authelia
|
||||
port: 22
|
||||
command_timeout: 10m
|
||||
# WICHTIG: Hier muss der Name deines Keys in GROSSBUCHSTABEN stehen
|
||||
envs:
|
||||
- DRONE_BUILD_PARAMS
|
||||
- ARGS
|
||||
- DRONE_BUILD_EVENT
|
||||
script: |
|
||||
set -eu
|
||||
|
||||
# Drone übergibt Build-Parameter als JSON-String in DRONE_BUILD_PARAMS
|
||||
# Beispiel: {"args": "mein-wert"}
|
||||
|
||||
ARGS=""
|
||||
if [ -n "${DRONE_BUILD_PARAMS:-}" ]; then
|
||||
# Extrahiere den Wert für den Key "args"
|
||||
ARGS=$(echo "$DRONE_BUILD_PARAMS" | sed -n 's/.*"args"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
|
||||
fi
|
||||
# Jetzt kannst du direkt auf $ARGS zugreifen,
|
||||
# da Drone den Key 'args' als Umgebungsvariable exportiert.
|
||||
|
||||
fetch -o /tmp/authelia-update.sh \
|
||||
https://git.familie-berner.de/Open/infra-maintenance/raw/branch/main/authelia/authelia-update.sh
|
||||
@@ -110,10 +100,10 @@ steps:
|
||||
chmod +x /tmp/authelia-update.sh
|
||||
|
||||
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
||||
echo "[INFO] Raw Params: ${DRONE_BUILD_PARAMS:-none}"
|
||||
echo "[INFO] Extracted Args: ${ARGS:-<none>}"
|
||||
echo "[INFO] Extracted Args: ${ARGS:-keine Parameter übergeben}"
|
||||
|
||||
timeout 10m /tmp/authelia-update.sh $ARGS
|
||||
# Ausführen mit dem Wert aus der UI (z.B. --apply)
|
||||
timeout 10m /tmp/authelia-update.sh ${ARGS:-}
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
|
||||
Reference in New Issue
Block a user