.drone.yml aktualisiert
This commit is contained in:
42
.drone.yml
42
.drone.yml
@@ -33,7 +33,7 @@ trigger:
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
|
||||
steps:
|
||||
- name: ssh-check
|
||||
image: appleboy/drone-ssh
|
||||
@@ -44,31 +44,26 @@ 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"}
|
||||
# Jetzt kannst du direkt auf $ARGS zugreifen,
|
||||
# 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 \
|
||||
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}"
|
||||
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
|
||||
@@ -78,7 +73,7 @@ trigger:
|
||||
event:
|
||||
- cron
|
||||
- custom
|
||||
|
||||
|
||||
steps:
|
||||
- name: ssh-check
|
||||
image: appleboy/drone-ssh
|
||||
@@ -89,31 +84,26 @@ 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"}
|
||||
# Jetzt kannst du direkt auf $ARGS zugreifen,
|
||||
# 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 \
|
||||
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}"
|
||||
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