-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
44 lines (36 loc) Β· 1.13 KB
/
deploy.sh
File metadata and controls
44 lines (36 loc) Β· 1.13 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
#!/bin/bash
# Deployment script for QuickShift API
echo "π Starting deployment process..."
# Check if we're in the right directory
if [ ! -f "package.json" ]; then
echo "β Error: package.json not found. Please run this script from the project root."
exit 1
fi
# Install dependencies
echo "π¦ Installing dependencies..."
npm ci --only=production
# Run any database migrations if needed
echo "ποΈ Checking database..."
# Add migration commands here if you have them
# Test the application
echo "π§ͺ Running health check..."
npm run build
# Test if the server starts
echo "π Testing server startup..."
timeout 10s npm start &
SERVER_PID=$!
sleep 5
# Check if server is responding
if curl -f http://localhost:8080/api/health > /dev/null 2>&1; then
echo "β
Server health check passed!"
kill $SERVER_PID
else
echo "β Server health check failed!"
kill $SERVER_PID 2>/dev/null
exit 1
fi
echo "π Deployment preparation complete!"
echo "π‘ Next steps:"
echo " 1. Push to your Git repository"
echo " 2. Configure environment variables in DigitalOcean"
echo " 3. Deploy through DigitalOcean App Platform"