Files
ospab.host/ospabhost/deploy.ps1
2025-11-23 14:35:16 +03:00

24 lines
1.0 KiB
PowerShell
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.
# Скрипт деплоя для ospabhost
# Запустите из корня проекта ospabhost/
Write-Host "🚀 Начинаем деплой..." -ForegroundColor Green
# 1. Загрузка backend
Write-Host "`n📦 Загружаем backend..." -ForegroundColor Yellow
scp -r backend/dist/* root@ospab.host:/var/www/ospab-host/backend/dist/
# 2. Загрузка frontend
Write-Host "`n📦 Загружаем frontend..." -ForegroundColor Yellow
scp -r frontend/dist/* root@ospab.host:/var/www/ospab-host/frontend/dist/
# 3. Перезапуск backend
Write-Host "`n♻️ Перезапускаем backend..." -ForegroundColor Yellow
ssh root@ospab.host "pm2 restart backend"
# 4. Очистка кеша nginx
Write-Host "`n🧹 Очищаем кеш nginx..." -ForegroundColor Yellow
ssh root@ospab.host "find /var/cache/nginx -type f -delete 2>/dev/null || true"
Write-Host "`n✅ Деплой завершён!" -ForegroundColor Green
Write-Host "Обновите страницу с Ctrl+F5 (hard refresh)" -ForegroundColor Cyan