mirror of
https://github.com/DeNNiiInc/Advanced-Raid-Calculator.git
synced 2026-04-17 12:45:59 +00:00
feat: add deployment automation scripts
This commit is contained in:
28
deploy.sh
Normal file
28
deploy.sh
Normal 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."
|
||||
Reference in New Issue
Block a user