Merge pull request #4 from living-ip/leo-auto-deploy-restart-scope

Restart Leo agent after Telegram deploy changes
This commit is contained in:
twentyOne2x 2026-06-20 01:48:40 +02:00 committed by GitHub
commit a84289a9fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,15 +88,24 @@ log "Files synced"
# Restart services only if Python files changed
RESTART=""
add_restart() {
case " $RESTART " in
*" $1 "*) ;;
*) RESTART="$RESTART $1" ;;
esac
}
if [ "$OLD_SHA" != "none" ]; then
if git diff --name-only "$OLD_SHA" "$NEW_SHA" -- lib/ teleo-pipeline.py reweave.py telegram/ 2>/dev/null | grep -q '\.py$'; then
RESTART="$RESTART teleo-pipeline"
add_restart teleo-pipeline
fi
if git diff --name-only "$OLD_SHA" "$NEW_SHA" -- telegram/ 2>/dev/null | grep -q '\.py$'; then
add_restart teleo-agent@leo
fi
if git diff --name-only "$OLD_SHA" "$NEW_SHA" -- diagnostics/ 2>/dev/null | grep -q '\.py$'; then
RESTART="$RESTART teleo-diagnostics"
add_restart teleo-diagnostics
fi
else
RESTART="teleo-pipeline teleo-diagnostics"
RESTART="teleo-pipeline teleo-diagnostics teleo-agent@leo"
fi
if [ -n "$RESTART" ]; then