schon/scripts/Unix/restart.sh
fureunoir 42b40627de Features: 1) Introduce CLI utility lessy.py to streamline project management tasks (e.g., install, run, restart, test); 2) Add Unix and Windows script commands for make-messages and compile-messages to improve translation workflow; 3) Include shared utility libraries (utils.sh, utils.ps1) for reusable functions across scripts.
Fixes: 1) Remove obsolete `reboot` scripts for Unix and Windows to prevent redundancy; 2) Update Windows `test.ps1` to handle omitted coverage patterns and improve error feedback.

Extra: 1) Refactor Windows scripts (`make-messages.ps1`, `compile-messages.ps1`, `backup.ps1`) to use shared utilities for better consistency and output formatting; 2) Add spinner-based progress indicators to enhance user experience in interactive environments.
2026-01-04 19:18:27 +03:00

65 lines
1.7 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
source ./scripts/Unix/starter.sh
# Shutdown services
log_step "Shutting down..."
if ! docker compose down; then
log_error "Failed to shut down services"
exit 1
fi
log_success "Services were shut down successfully!"
# Rebuild and start services
log_step "Spinning services up with rebuild..."
if ! docker compose up -d --build --wait; then
log_error "Failed to start services"
exit 1
fi
log_success "Services are up and healthy!"
# Run pre-run tasks
log_step "Completing pre-run tasks..."
log_info " → Running migrations..."
if ! docker compose exec app uv run manage.py migrate --no-input --verbosity 0; then
log_error "Migrations failed"
exit 1
fi
log_info " → Initializing..."
if ! docker compose exec app uv run manage.py initialize; then
log_error "Initialization failed"
exit 1
fi
log_info " → Setting default caches..."
if ! docker compose exec app uv run manage.py set_default_caches; then
log_error "Cache setup failed"
exit 1
fi
log_info " → Rebuilding search index..."
if ! docker compose exec app uv run manage.py search_index --rebuild -f; then
log_error "Search index rebuild failed"
exit 1
fi
log_info " → Collecting static files..."
if ! docker compose exec app uv run manage.py collectstatic --clear --no-input --verbosity 0; then
log_error "Static files collection failed"
exit 1
fi
log_success "Pre-run tasks completed successfully!"
# Cleanup
log_step "Cleaning up unused Docker data..."
if ! docker system prune -f; then
log_warning "Docker cleanup had issues, but continuing..."
fi
log_success "Unused Docker data cleaned successfully!"
echo
log_result "All done! eVibes is up and running!"