-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathupdate.sh
More file actions
53 lines (42 loc) · 1.2 KB
/
update.sh
File metadata and controls
53 lines (42 loc) · 1.2 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
#!/bin/bash
# Update script for orb_miner
# Run this after 'git pull' to update dependencies and restart services
echo "🔄 Updating ORB Miner..."
echo ""
# Install/update root dependencies
echo "📦 Installing root dependencies..."
npm install
# Install/update dashboard dependencies
echo "📦 Installing dashboard dependencies..."
cd dashboard
npm install
# Clear Next.js cache
echo "🧹 Clearing Next.js cache..."
rm -rf .next
cd ..
# Rebuild TypeScript
echo "🔨 Building bot..."
npm run build
# Rebuild dashboard
echo "🔨 Building dashboard..."
npm run build:dashboard
# Check if PM2 is running the processes
if command -v pm2 &> /dev/null; then
echo "🔄 Checking PM2 processes..."
# Restart bot if it's running
if pm2 list | grep -q "orb-bot"; then
echo "🔄 Restarting orb-bot..."
pm2 restart orb-bot
fi
# Restart dashboard if it's running
if pm2 list | grep -q "orb-dashboard"; then
echo "🔄 Restarting orb-dashboard..."
pm2 restart orb-dashboard
fi
fi
echo ""
echo "✅ Update complete!"
echo ""
echo "If you're not using PM2, restart your processes manually:"
echo " - Bot: npm start"
echo " - Dashboard: npm run start:dashboard"