retention fix
CI Feature / Load example-gitea-env.conf to pipeline env (push) Has been cancelled
CI Feature / Bats tests (push) Has been cancelled
CI Feature / Cucumber tests (push) Has been cancelled
CI Feature / Report Summary (push) Has been cancelled

This commit is contained in:
moilanik
2026-06-26 08:06:34 +03:00
parent e75b425294
commit 67f2511176
6 changed files with 540 additions and 61 deletions
+8 -1
View File
@@ -70,8 +70,15 @@ spec:
set -euo pipefail
echo "Retention sidecar: installing deps..."
apt-get update -qq
apt-get install -y --no-install-recommends curl jq python3 >/dev/null
apt-get install -y --no-install-recommends curl jq git ca-certificates >/dev/null
echo "Retention sidecar: ready"
# Sleep until 01:00 so retention runs at night
now_epoch=$(date +%s)
target_epoch=$(date -d "today 01:00:00" +%s)
[ "$target_epoch" -le "$now_epoch" ] && target_epoch=$((target_epoch + 86400))
sleep_sec=$((target_epoch - now_epoch))
echo "Retention sidecar: next run in $((sleep_sec / 3600))h (at 01:00)"
sleep $sleep_sec
while true; do
/scripts/retention-cleanup.sh
echo "Retention sidecar: next run in 24h"