SysOps: deploy-all — 2026-06-09 10:41 UTC

This commit is contained in:
sysops
2026-06-09 10:41:13 +00:00
parent 69fe67cc0e
commit 21ea3a2c81
82 changed files with 8906 additions and 981 deletions
+37
View File
@@ -48,6 +48,43 @@ curl -sf -o /dev/null -w "marketing:%{http_code}\n" http://127.0.0.1:8600/market
curl -sf -o /dev/null -w "ops:%{http_code}\n" http://127.0.0.1:8600/ops
curl -sf -o /dev/null -w "packaging:%{http_code}\n" http://127.0.0.1:8600/packaging
curl -sf -o /dev/null -w "agents:%{http_code}\n" http://127.0.0.1:8600/agents
echo "=== NAS client folders root ==="
mkdir -p /home/aissa/nas-clients
echo "=== Gitea SysOps user ==="
chmod +x scripts/setup_gitea_sysops.sh 2>/dev/null || true
bash scripts/setup_gitea_sysops.sh || true
echo "=== SysOps + Herman cron ==="
(crontab -l 2>/dev/null || true | grep -v sysops_daily.py | grep -v herman_daily_digest.py | grep -v herman_platform_update.py; \
echo "0 7 * * * cd $REMOTE_DIR && /usr/bin/python3 scripts/sysops_daily.py >> /tmp/sysops-daily.log 2>&1"; \
echo "30 7 * * * cd $REMOTE_DIR && /usr/bin/python3 scripts/herman_daily_digest.py >> /tmp/herman-daily.log 2>&1") | sort -u | crontab -
echo "Cron: SysOps 07:00, Herman briefing 07:30"
echo "=== Run SysOps daily now (test) ==="
cd "$REMOTE_DIR" && python3 scripts/sysops_daily.py || true
echo "=== Schedule Herman platform update over 2 uur ==="
if command -v at >/dev/null 2>&1; then
echo "cd $REMOTE_DIR && /usr/bin/python3 scripts/herman_platform_update.py >> /tmp/herman-update.log 2>&1" | at now + 2 hours 2>&1 || true
echo "Gepland via 'at now + 2 hours'"
else
UPD_H=$(date -d '+2 hours' +%H 2>/dev/null || date -v+2H +%H 2>/dev/null || echo "09")
UPD_M=$(date -d '+2 hours' +%M 2>/dev/null || date -v+2H +%M 2>/dev/null || echo "00")
(crontab -l 2>/dev/null || true; echo "\$UPD_M \$UPD_H * * * cd $REMOTE_DIR && /usr/bin/python3 scripts/herman_platform_update.py >> /tmp/herman-update.log 2>&1 # once") | sort -u | crontab -
echo "Gepland via cron om \$UPD_H:\$UPD_M"
fi
echo "=== SysOps Gitea sync (volledige repo) ==="
docker exec foodlinkk_tools_api python3 -c "
from app.connectors.gitea_repo_sync import run_gitea_repo_sync
import json
print(json.dumps(run_gitea_repo_sync('deploy-all'), indent=2))
" || echo "Gitea sync warning — check tools-api logs"
echo "=== Herman briefing nu genereren ==="
cd "$REMOTE_DIR" && python3 scripts/herman_daily_digest.py || true
REMOTE
echo "=== Deploy voltooid ==="