.drone.yml aktualisiert
This commit is contained in:
42
.drone.yml
42
.drone.yml
@@ -33,7 +33,7 @@ trigger:
|
|||||||
event:
|
event:
|
||||||
- pull_request
|
- pull_request
|
||||||
- push
|
- push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ssh-check
|
- name: ssh-check
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
@@ -44,31 +44,26 @@ 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
|
||||||
|
|
||||||
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
|
||||||
@@ -78,7 +73,7 @@ trigger:
|
|||||||
event:
|
event:
|
||||||
- cron
|
- cron
|
||||||
- custom
|
- custom
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ssh-check
|
- name: ssh-check
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
@@ -89,31 +84,26 @@ 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
|
||||||
|
|
||||||
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