-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-simple.ps1
More file actions
31 lines (26 loc) · 1.15 KB
/
deploy-simple.ps1
File metadata and controls
31 lines (26 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# SingFLEX Deployment Script
$SERVER = "renny@onetv.ng"
$DEPLOY_PATH = "/var/app/sf3"
Write-Host "Creating deployment package..." -ForegroundColor Cyan
$archiveName = "singflex-$(Get-Date -Format 'yyyyMMdd-HHmmss').tar.gz"
tar -czf $archiveName `
--exclude='node_modules' `
--exclude='.next' `
--exclude='dist' `
--exclude='uploads' `
--exclude='.env' `
--exclude='.env.local' `
--exclude='.git' `
--exclude='*.log' `
.
Write-Host "Uploading to server..." -ForegroundColor Yellow
scp $archiveName "${SERVER}:${DEPLOY_PATH}/"
Write-Host "Please enter server password to continue deployment..." -ForegroundColor Yellow
Write-Host "After upload, run these commands on server:" -ForegroundColor Cyan
Write-Host " cd /var/app/sf3" -ForegroundColor White
Write-Host " tar -xzf $archiveName" -ForegroundColor White
Write-Host " rm $archiveName" -ForegroundColor White
Write-Host " cd hub && npm install && npm run build" -ForegroundColor White
Write-Host " cd ../hubx && npm install && npm run build" -ForegroundColor White
Write-Host " bash ../server-setup.sh" -ForegroundColor White
Remove-Item $archiveName -ErrorAction SilentlyContinue