forked from linkong/planet
release: bump version to 0.65.0
This commit is contained in:
25
planet.sh
25
planet.sh
@@ -3319,7 +3319,7 @@ remove_planet_docker_state() {
|
||||
printf "%s\n" "$container_ids" | awk '/^[0-9a-f]{12,64}$/' | xargs -r docker rm -f >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
docker image rm "$AI_PROVIDER_IMAGE_NAME" postgres:15 redis:7-alpine >/dev/null 2>&1 || true
|
||||
docker image rm "$AI_PROVIDER_IMAGE_NAME" planet-aiprovider:latest postgres:15 redis:7-alpine >/dev/null 2>&1 || true
|
||||
|
||||
volume_names="$(docker volume ls -q --filter label=com.docker.compose.project=planet 2>/dev/null || true)"
|
||||
if [ -n "$volume_names" ]; then
|
||||
@@ -3328,6 +3328,19 @@ remove_planet_docker_state() {
|
||||
docker volume rm -f planet_postgres_data planet_redis_data postgres_data redis_data >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
reset_planet_database_for_destroy() {
|
||||
local postgres_container="planet_postgres"
|
||||
|
||||
docker ps --format '{{.Names}}' 2>/dev/null | grep -qx "$postgres_container" || return 0
|
||||
|
||||
docker exec "$postgres_container" psql -U postgres -d planet_db -v ON_ERROR_STOP=1 >/dev/null 2>&1 <<'SQL' || true
|
||||
DROP SCHEMA IF EXISTS public CASCADE;
|
||||
CREATE SCHEMA public;
|
||||
GRANT ALL ON SCHEMA public TO postgres;
|
||||
GRANT ALL ON SCHEMA public TO public;
|
||||
SQL
|
||||
}
|
||||
|
||||
remove_planet_build_state() {
|
||||
rm -rf \
|
||||
"$SCRIPT_DIR/.venv" \
|
||||
@@ -3342,6 +3355,11 @@ remove_planet_build_state() {
|
||||
"$SCRIPT_DIR/frontend/dist-ssr" \
|
||||
"$PLANET_STATE_DIR" \
|
||||
"$PLANET_CACHE_DIR"
|
||||
|
||||
find "$SCRIPT_DIR" \
|
||||
\( -path "$SCRIPT_DIR/.git" -o -path "$SCRIPT_DIR/frontend/node_modules" -o -path "$SCRIPT_DIR/node_modules" \) -prune \
|
||||
-o \( -type d \( -name __pycache__ -o -name .pytest_cache -o -name .ruff_cache -o -name .mypy_cache -o -name .vite \) -print \) \
|
||||
| xargs -r rm -rf
|
||||
}
|
||||
|
||||
destroy() {
|
||||
@@ -3354,6 +3372,11 @@ destroy() {
|
||||
stop_frontend_service
|
||||
stop_motion_agent_service
|
||||
|
||||
start_wait_session "重置数据库 OOBE 状态"
|
||||
reset_planet_database_for_destroy
|
||||
stop_wait_session
|
||||
log_success "数据库 OOBE 状态已重置"
|
||||
|
||||
start_wait_session "清理 Docker 状态"
|
||||
remove_planet_docker_state
|
||||
stop_wait_session
|
||||
|
||||
Reference in New Issue
Block a user