Files
smartsoltech_site/bin/start.sh
Andrey K. Choi 8f1e0459fc 🔧 Restructure scripts and add CLI tool
 New features:
- Add CLI tool for container command execution
- Reorganize all scripts into bin/ directory
- Create convenient wrappers in project root
- Add local changes auto-commit functionality
- Enhanced backup repository management

📁 Structure changes:
- Move all scripts to bin/ directory
- Create wrapper scripts in root (cli, update, start, stop, logs)
- Add setup-backup.sh for backup repository management
- Update documentation with new CLI examples

🛠️ CLI capabilities:
- Django commands (shell, migrate, collectstatic, etc.)
- System commands (bash, logs, status)
- Container management (restart, status)
- Interactive and non-interactive modes

📚 Documentation:
- Updated SCRIPTS_README.md with CLI examples
- Added troubleshooting section
- Comprehensive usage examples
2025-11-25 06:51:52 +09:00

67 lines
1.7 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# =============================================================================
# SmartSolTech - Быстрый скрипт запуска разработки
# =============================================================================
set -e
# Цвета для вывода
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log() {
echo -e "${BLUE}[$(date '+%Y-%m-%d %H:%M:%S')]${NC} $1"
}
success() {
echo -e "${GREEN}$1${NC}"
}
warning() {
echo -e "${YELLOW}⚠️ $1${NC}"
}
echo ""
echo "🚀 SmartSolTech - Быстрый запуск"
echo "==============================="
echo ""
# Проверка docker-compose.yml
if [ ! -f "docker-compose.yml" ]; then
echo "❌ docker-compose.yml не найден. Запустите скрипт из корня проекта."
exit 1
fi
# Запуск контейнеров
log "Запуск сервисов..."
docker-compose up -d
# Ожидание готовности
log "Ожидание готовности сервисов..."
sleep 10
# Статус
echo ""
log "Статус сервисов:"
docker-compose ps
echo ""
success "Сервисы запущены!"
echo ""
echo "📊 Доступные ресурсы:"
echo " • Веб-сайт: http://localhost:8000"
echo " • Админка: http://localhost:8000/admin"
echo " • PgAdmin: http://localhost:8080"
echo ""
# Предложение показать логи
read -p "Показать логи в реальном времени? (y/N): " show_logs_choice
if [[ $show_logs_choice =~ ^[Yy]$ ]]; then
echo ""
warning "Для выхода из логов нажмите Ctrl+C"
sleep 2
docker-compose logs -f
fi