Files
code-review-agent/uninstall-ubuntu.sh
T
Primakov Alexandr Alexandrovich 48fbb5bcb3 Add deployment script and documentation for Ubuntu setup
- Introduced `deploy-ubuntu.sh` for automated deployment of the AI Code Review Platform on Ubuntu with systemd.
- Added `UBUNTU_DEPLOYMENT.md` for detailed deployment instructions and requirements.
- Updated `README.md` to include quick deployment instructions and features of the new script.
- Created `uninstall-ubuntu.sh` for easy removal of the platform and its components.
- Enhanced logging and configuration setup within the deployment script.
2025-10-12 23:39:59 +03:00

62 lines
1.8 KiB
Bash

#!/bin/bash
# Скрипт удаления AI Code Review Platform из Ubuntu
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}Ошибка: Этот скрипт должен быть запущен с sudo${NC}"
exit 1
fi
echo -e "${YELLOW}"
echo "========================================="
echo " AI Code Review Platform - Удаление"
echo "========================================="
echo -e "${NC}"
echo ""
echo -e "${RED}⚠️ ВНИМАНИЕ: Это удалит все данные!${NC}"
echo ""
echo -e "Вы уверены? Введите 'yes' для подтверждения:"
read -r confirmation
if [ "$confirmation" != "yes" ]; then
echo "Отменено"
exit 0
fi
INSTALL_DIR="/opt/ai-review"
echo -e "${YELLOW}[1/5] Остановка сервиса...${NC}"
systemctl stop ai-review.service || true
systemctl disable ai-review.service || true
echo -e "${GREEN}✓ Сервис остановлен${NC}"
echo -e "${YELLOW}[2/5] Удаление systemd service...${NC}"
rm -f /etc/systemd/system/ai-review.service
systemctl daemon-reload
echo -e "${GREEN}✓ Service удален${NC}"
echo -e "${YELLOW}[3/5] Удаление nginx конфигурации...${NC}"
rm -f /etc/nginx/sites-enabled/ai-review
rm -f /etc/nginx/sites-available/ai-review
systemctl reload nginx 2>/dev/null || true
echo -e "${GREEN}✓ Nginx конфигурация удалена${NC}"
echo -e "${YELLOW}[4/5] Удаление файлов...${NC}"
rm -rf "$INSTALL_DIR"
echo -e "${GREEN}✓ Файлы удалены${NC}"
echo -e "${YELLOW}[5/5] Удаление логов...${NC}"
rm -rf /var/log/ai-review
echo -e "${GREEN}✓ Логи удалены${NC}"
echo ""
echo -e "${GREEN}✓ AI Code Review Platform полностью удален${NC}"
echo ""