-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·66 lines (62 loc) · 1.61 KB
/
deploy.sh
File metadata and controls
executable file
·66 lines (62 loc) · 1.61 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
#!/bin/bash
# RugScore Bot — VPS deploy script
# Usage: ./deploy.sh [command]
# start — Build & start (default)
# stop — Stop the bot
# restart — Rebuild & restart
# logs — Tail live logs
# status — Show container status
# update — Git pull + rebuild + restart
set -e
COMPOSE="docker compose"
SERVICE="rugscore-bot"
# Check .env exists
check_env() {
if [ ! -f .env ]; then
echo "ERROR: .env file not found!"
echo "Create one with at least:"
echo " TELEGRAM_BOT_TOKEN=your_token"
echo " HELIUS_API_KEY=your_key"
echo " ADMIN_IDS=your_telegram_id"
exit 1
fi
}
case "${1:-start}" in
start)
check_env
echo "Building & starting RugScore Bot..."
$COMPOSE up -d --build
echo "Done! Use './deploy.sh logs' to see output."
;;
stop)
echo "Stopping RugScore Bot..."
$COMPOSE down
echo "Stopped."
;;
restart)
check_env
echo "Rebuilding & restarting RugScore Bot..."
$COMPOSE down
$COMPOSE up -d --build
echo "Done! Use './deploy.sh logs' to see output."
;;
logs)
$COMPOSE logs -f $SERVICE
;;
status)
$COMPOSE ps
;;
update)
check_env
echo "Pulling latest code..."
git pull
echo "Rebuilding & restarting..."
$COMPOSE down
$COMPOSE up -d --build
echo "Updated! Use './deploy.sh logs' to see output."
;;
*)
echo "Usage: ./deploy.sh {start|stop|restart|logs|status|update}"
exit 1
;;
esac