-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeployBot
More file actions
46 lines (31 loc) · 1.06 KB
/
DeployBot
File metadata and controls
46 lines (31 loc) · 1.06 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
#!/bin/bash
# Stop the lichess-bot running process in tmux by sending Ctrl+C
tmux send-keys -t mysession C-c
# Navigate to ChessEngine100 directory
cd FreddyyBot || exit
# Pull the latest code
git pull
# Clean and build the project
make clean
make build
# Remove the old main executable from lichess-bot/engines
rm -f ../lichess-bot/engines/main
# Remove the old config
rm -f ../lichess-bot/config.yml
# Copy the new main executable to lichess-bot/engines
cp build/bin/main ../lichess-bot/engines
# Copy the new config
cp lichess_bot_config.yml ../lichess-bot
# Change directory to lichess-bot
cd ../lichess-bot || exit
mv lichess_bot_config.yml config.yml
# Pull the latest lichess-bot code
git pull
# Read the secret token from secret.txt
secret=$(<secret.txt)
# Replace the placeholder token "XXXXXXXXXX" in config.yml with the secret
sed -i "s|XXXXXXXXXX|${secret}|g" config.yml
# Start the lichess-bot in the tmux session
tmux send-keys -t mysession 'python3 lichess-bot.py -v' Enter
# Attach to the tmux session (Ctrl+b then d to detach)
tmux attach -t mysession