feat: add deployment automation scripts

This commit is contained in:
2025-12-27 15:42:26 +11:00
parent 87f1711cbd
commit 33b2b708f4
9 changed files with 951 additions and 0 deletions

28
deploy.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Ensure we are in the project directory
cd "$(dirname "$0")"
echo "Deploying Advanced Raid Calculator..."
# Install dependencies
echo "Installing dependencies..."
npm install
# Restart the application using PM2
if command -v pm2 &> /dev/null; then
echo "Restarting with PM2..."
# Check if the process is already running
if pm2 list | grep -q "raid-calculator"; then
pm2 reload raid-calculator
else
pm2 start server.js --name "raid-calculator"
fi
pm2 save
else
echo "PM2 not found. Please install PM2 globally (npm install -g pm2)."
# Fallback for testing without PM2, though PM2 is expected on the TurnKey template
# node server.js
fi
echo "Deployment complete."