Healthchecks heartbeats for renovate and gitea-bundle-mirror (6h jobs)
Same endpoint-agnostic ping via EXIT trap. These two jobs have no warning level, so only rc==0 pings success, any non-zero pings /fail. gitea-bundle edit is POSIX-sh clean (script is /bin/sh). Capability URLs from per-job host secret files. bash -n verified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,12 @@ bundle_target_for_repo() {
|
|||||||
cleanup() {
|
cleanup() {
|
||||||
rm -rf "$TMP_ROOT/run.$$"
|
rm -rf "$TMP_ROOT/run.$$"
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
# Healthchecks Heartbeat (endpoint-agnostisch; Capability-URL ist ein Secret, nie ins Repo)
|
||||||
|
HC_URL_FILE="${HC_URL_FILE:-/mnt/user/appdata/secrets/healthchecks_gitea_bundle_url}"
|
||||||
|
hc_url=""; [ -r "$HC_URL_FILE" ] && hc_url="$(tr -d '[:space:]' < "$HC_URL_FILE")"
|
||||||
|
hc_ping() { [ -n "$hc_url" ] || return 0; curl -fsS -m 10 --retry 3 "${hc_url}${1:-}" >/dev/null 2>&1 || true; }
|
||||||
|
trap 'hc_rc=$?; cleanup; [ "$hc_rc" -eq 0 ] && hc_ping "" || hc_ping "/fail"' EXIT
|
||||||
|
hc_ping "/start"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
need_cmd git
|
need_cmd git
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ RENOVATE_CONFIG_FILE="${RENOVATE_CONFIG_FILE:-/mnt/user/services/homelab-infra/o
|
|||||||
# Compose). Wir mappen direkt auf die LAN-IP des Unraid-Hosts.
|
# Compose). Wir mappen direkt auf die LAN-IP des Unraid-Hosts.
|
||||||
GITEA_HOST_LAN_IP="${GITEA_HOST_LAN_IP:-192.168.178.58}"
|
GITEA_HOST_LAN_IP="${GITEA_HOST_LAN_IP:-192.168.178.58}"
|
||||||
|
|
||||||
|
# Healthchecks Heartbeat (endpoint-agnostisch; Capability-URL ist ein Secret, nie ins Repo)
|
||||||
|
HC_URL_FILE="${HC_URL_FILE:-/mnt/user/appdata/secrets/healthchecks_renovate_url}"
|
||||||
|
hc_url=""; [ -r "$HC_URL_FILE" ] && hc_url="$(tr -d '[:space:]' < "$HC_URL_FILE")"
|
||||||
|
hc_ping() { [ -n "$hc_url" ] || return 0; curl -fsS -m 10 --retry 3 "${hc_url}${1:-}" >/dev/null 2>&1 || true; }
|
||||||
|
trap 'hc_rc=$?; [ "$hc_rc" -eq 0 ] && hc_ping "" || hc_ping "/fail"' EXIT
|
||||||
|
hc_ping "/start"
|
||||||
|
|
||||||
if [ ! -r "$RENOVATE_TOKEN_FILE" ]; then
|
if [ ! -r "$RENOVATE_TOKEN_FILE" ]; then
|
||||||
echo "Renovate token file missing or unreadable: $RENOVATE_TOKEN_FILE" >&2
|
echo "Renovate token file missing or unreadable: $RENOVATE_TOKEN_FILE" >&2
|
||||||
echo "See ops/renovate/run-renovate.sh header for operator setup steps." >&2
|
echo "See ops/renovate/run-renovate.sh header for operator setup steps." >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user