-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-to-render.ps1
More file actions
75 lines (66 loc) · 2.68 KB
/
Copy pathdeploy-to-render.ps1
File metadata and controls
75 lines (66 loc) · 2.68 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# CodeCollab Render Deployment Script for Windows
Write-Host "🚀 Preparing CodeCollab for Render Deployment" -ForegroundColor Green
Write-Host "==============================================" -ForegroundColor Green
# Check if we're in a git repository
if (-not (Test-Path ".git")) {
Write-Host "❌ Error: Not in a git repository. Please run 'git init' first." -ForegroundColor Red
exit 1
}
# Check if remote origin exists
try {
git remote get-url origin | Out-Null
Write-Host "✅ Git repository detected" -ForegroundColor Green
} catch {
Write-Host "❌ Error: No remote origin set. Please add your GitHub repository:" -ForegroundColor Red
Write-Host " git remote add origin https://github.com/yourusername/codecollab.git" -ForegroundColor Yellow
exit 1
}
# Add all deployment files
Write-Host "📁 Adding deployment files..." -ForegroundColor Yellow
git add .
git add render.yaml
git add docker-compose.render.yml
git add backend/Dockerfile.prod
git add backend/app.py
git add frontend/frontend/Dockerfile.prod
git add frontend/frontend/nginx.conf
git add RENDER-DEPLOYMENT-GUIDE.md
# Commit changes
Write-Host "💾 Committing deployment configuration..." -ForegroundColor Yellow
$commitMessage = @"
Add Render deployment configuration
- Add render.yaml blueprint
- Add production Dockerfiles
- Add nginx configuration for frontend
- Add deployment documentation
- Configure environment variables for Render
- Set up proper port handling for cloud deployment
"@
git commit -m $commitMessage
# Push to repository
Write-Host "📤 Pushing to GitHub..." -ForegroundColor Yellow
try {
git push origin main
} catch {
try {
git push origin master
} catch {
Write-Host "❌ Failed to push. Please check your git configuration." -ForegroundColor Red
exit 1
}
}
Write-Host ""
Write-Host "🎉 Repository updated successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "📋 Next Steps:" -ForegroundColor Cyan
Write-Host "1. Go to https://dashboard.render.com" -ForegroundColor White
Write-Host "2. Click 'New' → 'Blueprint'" -ForegroundColor White
Write-Host "3. Connect your GitHub repository" -ForegroundColor White
Write-Host "4. Select your CodeCollab repository" -ForegroundColor White
Write-Host "5. Render will read render.yaml and deploy both services" -ForegroundColor White
Write-Host ""
Write-Host "📖 For detailed instructions, see: RENDER-DEPLOYMENT-GUIDE.md" -ForegroundColor Yellow
Write-Host ""
Write-Host "🌍 Your app will be available at:" -ForegroundColor Cyan
Write-Host " Frontend: https://codecollab-frontend.onrender.com" -ForegroundColor Green
Write-Host " Backend: https://codecollab-backend.onrender.com" -ForegroundColor Green