Restart Leo agent after Telegram deploy changes
This commit is contained in:
parent
2e7d4e7450
commit
f3c63e2f8d
1 changed files with 12 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue