try to automate upgrade of A.I. nodes

This commit is contained in:
Thibault Duplessis 2015-05-12 01:52:35 +02:00
parent d32490926f
commit 6881fe009d
2 changed files with 49 additions and 2 deletions

View file

@ -5,8 +5,6 @@ cd local
rm -rf Stockfish
git clone https://github.com/ddugovic/Stockfish
cd Stockfish/src
# git reset --hard 271582eaa5d43afd4ef48ec3d8bcdfc724ac148e
# git reset --hard 60b7cb1
if [[ $1 = "old" ]]; then
make build ARCH=x86-64
else

49
bin/prod/upgrade-ai-nodes Executable file
View file

@ -0,0 +1,49 @@
#!/bin/sh
. bin/lilarc
for node in cammy; do
# for node in paul salim2 hexal matthews jaldus patat cammy adele; do
if [ $node = "paul" ]; then
REMOTE="paul"
REMOTE_DIR="/home/lila5"
RESTART="service lila5 restart"
elif [ $node = "salim2" ]; then
REMOTE="salim2"
REMOTE_DIR="/home/lila"
RESTART="pkill java && cd /home/lila && bin/lila -Dconfig.file=/home/lila/application.conf -Dhttp.port=9000 -mem 128 > logs/output.log 2>&1 &"
elif [ $node = "hexal" ]; then
REMOTE="hexal"
REMOTE_DIR="/home/lila"
RESTART="pkill java && cd /home/lila && bin/lila -Dconfig.file=/home/lila/application.conf -Dhttp.port=9000 -mem 128 > logs/output.log 2>&1 &"
elif [ $node = "matthews" ]; then
REMOTE="matthews"
REMOTE_DIR="/home/thibault/lila"
RESTART="cd /home/thibault/lila && bin/lila -mem 128 -Dhttp.port=9009 -Dconfig.file=/home/thibault/lila/application.conf > logs/output 2>&1 &"
elif [ $node = "jaldus" ]; then
REMOTE="jaldus"
REMOTE_DIR="/home/ornicar"
RESTART="sudo pkill java && cd /home/ornicar && bin/lila -mem 128 -Dhttp.port=9009 -Dconfig.file=/home/ornicar/application.conf > logs/output.log 2>&1 &"
elif [ $node = "patat" ]; then
REMOTE="patat"
REMOTE_DIR="/home/lichess"
RESTART="pkill java"
elif [ $node = "neary" ]; then
REMOTE="neary"
REMOTE_DIR="/home/lichess"
# outdated
elif [ $node = "cammy" ]; then
REMOTE="cammy"
REMOTE_DIR="/home/lichess"
RESTART='pkill java && cd /home/lichess && bin/lila -Dconfig.file=/home/lichess/application.conf -Dhttp.port=9009 -mem 128 > logs/output.log 2>&1 &'
elif [ $node = "adele" ]; then
REMOTE="adele"
REMOTE_DIR="/home/lichess"
RESTART='pkill java && cd /home/lichess && bin/lila -Dconfig.file=/home/lichess/application.conf -Dhttp.port=9009 -mem 128 > logs/output.log 2>&1 &'
elif [ $node = "local" ]; then
REMOTE="localhost"
REMOTE_DIR="/tmp/lila5"
fi
lilalog "Deploy to $node server $REMOTE:$REMOTE_DIR"
# ssh $REMOTE "cd $REMOTE_DIR; $RESTART"
ssh $REMOTE "cd $REMOTE_DIR; bin/install-stockfish; $RESTART"
done