forked from mtusi2026/mtusi2026lab4
ЛР4: не перезапускать основной стенд автоматически после clean-clone
This commit is contained in:
@@ -44,22 +44,8 @@ cleanup() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
if [ "$main_was_running" = "1" ]; then
|
if [ "$main_was_running" = "1" ]; then
|
||||||
# The clone exported COMPOSE_PROJECT_NAME/LB_PORT/IMAGE for its own
|
echo "main lab4 stand was stopped for the check; data volumes are preserved."
|
||||||
# compose project. Do not leak them into the main stand restart.
|
echo "run 'make up' in $root to restart it."
|
||||||
(
|
|
||||||
cd "$root"
|
|
||||||
unset COMPOSE_PROJECT_NAME LB_PORT IMAGE BASE_URL API_IMAGE
|
|
||||||
attempt=0
|
|
||||||
while [ "$attempt" -lt 3 ]; do
|
|
||||||
if make up >/dev/null 2>&1 && ./scripts/wait-ready.sh >/dev/null 2>&1; then
|
|
||||||
echo "main stand restarted after the clean-clone check"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
attempt=$((attempt + 1))
|
|
||||||
sleep 3
|
|
||||||
done
|
|
||||||
echo "clean-clone-check: could not restart the main stand; run make up manually" >&2
|
|
||||||
)
|
|
||||||
fi
|
fi
|
||||||
exit "$status"
|
exit "$status"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user