.drone.yml aktualisiert
This commit is contained in:
38
.drone.yml
38
.drone.yml
@@ -44,20 +44,15 @@ steps:
|
|||||||
from_secret: password_authelia
|
from_secret: password_authelia
|
||||||
port: 22
|
port: 22
|
||||||
command_timeout: 10m
|
command_timeout: 10m
|
||||||
|
# WICHTIG: Hier muss der Name deines Keys in GROSSBUCHSTABEN stehen
|
||||||
envs:
|
envs:
|
||||||
- DRONE_BUILD_PARAMS
|
- ARGS
|
||||||
- DRONE_BUILD_EVENT
|
- DRONE_BUILD_EVENT
|
||||||
script: |
|
script: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Drone übergibt Build-Parameter als JSON-String in DRONE_BUILD_PARAMS
|
# Jetzt kannst du direkt auf $ARGS zugreifen,
|
||||||
# Beispiel: {"args": "mein-wert"}
|
# da Drone den Key 'args' als Umgebungsvariable exportiert.
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
||||||
@@ -65,10 +60,10 @@ steps:
|
|||||||
chmod +x /tmp/authelia-update.sh
|
chmod +x /tmp/authelia-update.sh
|
||||||
|
|
||||||
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
||||||
echo "[INFO] Raw Params: ${DRONE_BUILD_PARAMS:-none}"
|
echo "[INFO] Extracted Args: ${ARGS:-keine Parameter übergeben}"
|
||||||
echo "[INFO] Extracted Args: ${ARGS:-<none>}"
|
|
||||||
|
|
||||||
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
|
kind: pipeline
|
||||||
@@ -89,20 +84,15 @@ steps:
|
|||||||
from_secret: password_authelia
|
from_secret: password_authelia
|
||||||
port: 22
|
port: 22
|
||||||
command_timeout: 10m
|
command_timeout: 10m
|
||||||
|
# WICHTIG: Hier muss der Name deines Keys in GROSSBUCHSTABEN stehen
|
||||||
envs:
|
envs:
|
||||||
- DRONE_BUILD_PARAMS
|
- ARGS
|
||||||
- DRONE_BUILD_EVENT
|
- DRONE_BUILD_EVENT
|
||||||
script: |
|
script: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Drone übergibt Build-Parameter als JSON-String in DRONE_BUILD_PARAMS
|
# Jetzt kannst du direkt auf $ARGS zugreifen,
|
||||||
# Beispiel: {"args": "mein-wert"}
|
# da Drone den Key 'args' als Umgebungsvariable exportiert.
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
||||||
@@ -110,10 +100,10 @@ steps:
|
|||||||
chmod +x /tmp/authelia-update.sh
|
chmod +x /tmp/authelia-update.sh
|
||||||
|
|
||||||
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
echo "[INFO] Build event: ${DRONE_BUILD_EVENT}"
|
||||||
echo "[INFO] Raw Params: ${DRONE_BUILD_PARAMS:-none}"
|
echo "[INFO] Extracted Args: ${ARGS:-keine Parameter übergeben}"
|
||||||
echo "[INFO] Extracted Args: ${ARGS:-<none>}"
|
|
||||||
|
|
||||||
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
|
kind: pipeline
|
||||||
|
|||||||
Reference in New Issue
Block a user