diff --git a/scripts/rsync_deploy.sh b/scripts/rsync_deploy.sh index 2155ebd..846dc8f 100755 --- a/scripts/rsync_deploy.sh +++ b/scripts/rsync_deploy.sh @@ -28,7 +28,7 @@ EXCLUDES=( send_remote_report() { local text="$1" - ssh "$REMOTE" "cd '$REMOTE_DIR' && CARPASS_REPORT_TEXT=\$(cat) $COMPOSE exec -T -e CARPASS_REPORT_TEXT api python scripts/send_telegram_report.py" <<<"$text" || true + ssh "$REMOTE" "cd '$REMOTE_DIR' && export CARPASS_REPORT_TEXT=\$(cat); if $COMPOSE exec -T api test -f scripts/send_telegram_report.py >/dev/null 2>&1; then $COMPOSE exec -T -e CARPASS_REPORT_TEXT api python scripts/send_telegram_report.py; else $COMPOSE run --rm --no-deps -e CARPASS_REPORT_TEXT api python scripts/send_telegram_report.py; fi" <<<"$text" || true } fail_report() {