rm some old scripts
parent
147fad2433
commit
7c31b7e99b
12
bin/lilarc
12
bin/lilarc
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
PROD_URL="https://lichess.org"
|
||||
|
||||
lilalog () {
|
||||
echo -e "\x1b[7m[lila]\x1b[0m $1"
|
||||
}
|
||||
|
||||
curl_prod () {
|
||||
lilalog "Test $PROD_URL"
|
||||
curl -sL -w "%{http_code}" -o /dev/null "$PROD_URL"
|
||||
}
|
121
bin/old/deploy
121
bin/old/deploy
|
@ -1,121 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
. bin/lilarc
|
||||
|
||||
mode=$1
|
||||
|
||||
if [ -z $mode ]; then
|
||||
echo "Empty deploy target"
|
||||
exit 1
|
||||
elif [ $mode = "main" ]; then
|
||||
REMOTE="keres"
|
||||
REMOTE_DIR="/home/lichess3"
|
||||
FRONT_REMOTE="root@maple.lichess.ovh"
|
||||
FRONT_REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $mode = "ocean" ]; then
|
||||
REMOTE="root@ocean.lichess.ovh"
|
||||
REMOTE_DIR="/home/lichess-master-thib"
|
||||
FRONT_REMOTE="root@maple.lichess.ovh"
|
||||
FRONT_REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $mode = "stage" ]; then
|
||||
REMOTE="khiaw"
|
||||
REMOTE_DIR="/home/lichess-deploy"
|
||||
FRONT_REMOTE="khiaw"
|
||||
FRONT_REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $mode = "stress" ]; then
|
||||
REMOTE="listress"
|
||||
REMOTE_DIR="/home/lichess"
|
||||
FRONT_REMOTE=$REMOTE
|
||||
FRONT_REMOTE_DIR=$REMOTE_DIR
|
||||
else
|
||||
echo "Unknown deploy target $mode"
|
||||
exit 1
|
||||
fi
|
||||
stage="target/universal/stage"
|
||||
|
||||
lilalog "Deploy to $mode server $REMOTE:$REMOTE_DIR"
|
||||
|
||||
echo "##################################################"
|
||||
echo "# #"
|
||||
echo "# * Deploy and restart * #"
|
||||
echo "# #"
|
||||
echo "##################################################"
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
if [ "$2" = "asset" ]; then
|
||||
./ui/build prod
|
||||
fi
|
||||
|
||||
rm -rf $stage
|
||||
./lila -Depoll=true stage
|
||||
if [ $? != 0 ]; then
|
||||
lilalog "Deploy canceled"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# if [ $mode = "main" ]; then
|
||||
# lilalog "Backup production lichess dir"
|
||||
# BACKUP_DIR=/home/backup/lichess-$(date +%Y-%m-%d_%H-%M)
|
||||
# ssh $REMOTE "echo $BACKUP_DIR && cp -r $REMOTE_DIR $BACKUP_DIR && rm $BACKUP_DIR/RUNNING_PID && chown -R lichess:lichess $BACKUP_DIR"
|
||||
# fi
|
||||
|
||||
# read -n 1 -p "Press [Enter] to rsync to $REMOTE:$REMOTE_DIR"
|
||||
|
||||
RSYNC_OPTIONS=" \
|
||||
--archive \
|
||||
--no-o --no-g \
|
||||
--force \
|
||||
--delete \
|
||||
--progress \
|
||||
--compress \
|
||||
--checksum \
|
||||
--verbose \
|
||||
--exclude public \
|
||||
--exclude conf/application.conf \
|
||||
--exclude RUNNING_PID \
|
||||
--exclude '*.psd' \
|
||||
--exclude '*.h' \
|
||||
--exclude '*.cpp' \
|
||||
--exclude '*.xcf' \
|
||||
--exclude '.git/' \
|
||||
--exclude node_modules"
|
||||
|
||||
lilalog "Rsync scripts, binaries and assets"
|
||||
include="bin $stage/bin $stage/lib public"
|
||||
rsync_command="rsync $RSYNC_OPTIONS $include $REMOTE:$REMOTE_DIR"
|
||||
echo "$rsync_command"
|
||||
$rsync_command
|
||||
echo "rsync complete"
|
||||
|
||||
if [ $mode == "main" ]; then
|
||||
lilalog "Deploy logger configuration"
|
||||
rsync -av conf/prod-logger.xml $REMOTE:/etc/lichess.logger.xml
|
||||
fi
|
||||
|
||||
if [ $FRONT_REMOTE ] && [ $FRONT_REMOTE_DIR ]; then
|
||||
lilalog "Deploy assets to $mode frontend server $FRONT_REMOTE:$FRONT_REMOTE_DIR"
|
||||
rsync --archive --no-o --no-g --progress --exclude '*.dev.css' public $FRONT_REMOTE:$FRONT_REMOTE_DIR
|
||||
fi
|
||||
|
||||
read -n 1 -p "Press [Enter] to complete deployment to $mode server $REMOTE:$REMOTE_DIR"
|
||||
|
||||
if [ $mode = "main" ]; then
|
||||
lilalog "Restart lichess"
|
||||
SSH_COMMAND="chown -R lichess:lichess $REMOTE_DIR && systemctl restart lichess3"
|
||||
echo $SSH_COMMAND
|
||||
ssh $REMOTE $SSH_COMMAND
|
||||
fi
|
||||
if [ $mode = "stage" ]; then
|
||||
lilalog "Restart lichess-stage"
|
||||
SSH_COMMAND="chown -R lichess:lichess $REMOTE_DIR && systemctl restart lichess-stage"
|
||||
echo $SSH_COMMAND
|
||||
ssh $REMOTE $SSH_COMMAND
|
||||
fi
|
||||
if [ $mode = "stress" ]; then
|
||||
lilalog "Restart listress"
|
||||
SSH_COMMAND="chown -R lichess:lichess $REMOTE_DIR && systemctl restart lichess"
|
||||
echo $SSH_COMMAND
|
||||
ssh $REMOTE $SSH_COMMAND
|
||||
fi
|
||||
|
||||
lilalog "Deploy complete"
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
. bin/lilarc
|
||||
|
||||
to=$1
|
||||
mode=${2-build} # build | css | js | upload
|
||||
|
||||
if [ -z $to ]; then
|
||||
echo "Empty deploy target"
|
||||
exit 1
|
||||
elif [ $to = "main" ]; then
|
||||
REMOTE="root@maple.lichess.ovh"
|
||||
REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $to = "stage" ]; then
|
||||
REMOTE="khiaw"
|
||||
REMOTE_DIR="/home/lichess-stage"
|
||||
elif [ $to = "syrup" ]; then
|
||||
REMOTE="root@syrup.lichess.ovh"
|
||||
REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $to = "maple" ]; then
|
||||
REMOTE="root@maple.lichess.ovh"
|
||||
REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $to = "ocean" ]; then
|
||||
REMOTE="root@ocean.lichess.ovh"
|
||||
REMOTE_DIR="/home/lichess-deploy"
|
||||
elif [ $to = "stress" ]; then
|
||||
REMOTE="listress"
|
||||
REMOTE_DIR="/home/lichess"
|
||||
else
|
||||
echo "Unknown deploy target $to"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lilalog "Deploy prod $mode assets to $to server $REMOTE:$REMOTE_DIR"
|
||||
|
||||
if [ "$mode" != "upload" ]; then
|
||||
./ui/build prod $mode
|
||||
fi
|
||||
|
||||
lilalog "Rsync scripts"
|
||||
rsync --archive --no-o --no-g --progress --exclude '*.dev.css' public $REMOTE:$REMOTE_DIR
|
||||
|
||||
# SSH_COMMAND="chown -R lichess:lichess $REMOTE_DIR"
|
||||
# echo $SSH_COMMAND
|
||||
# ssh $REMOTE $SSH_COMMAND
|
||||
|
||||
lilalog "Deploy complete"
|
||||
|
||||
if [ $to = "main" ]; then
|
||||
xdg-open https://lichess.org/dev/cli
|
||||
fi
|
||||
if [ $to = "stage" ]; then
|
||||
xdg-open https://lichess.dev/dev/cli
|
||||
fi
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
. bin/lilarc
|
||||
|
||||
REMOTE="frank"
|
||||
REMOTE_DIR="/home/lichess"
|
||||
|
||||
lilalog "Rsync scripts"
|
||||
rsync --archive --progress bin $REMOTE:$REMOTE_DIR
|
||||
|
||||
lilalog "Deploy complete"
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
. bin/lilarc
|
||||
|
||||
REMOTE=$1
|
||||
REMOTE_DIR=$2
|
||||
|
||||
lilalog "Rsync scripts"
|
||||
rsync --archive --progress bin $REMOTE:$REMOTE_DIR
|
||||
|
||||
lilalog "Deploy complete"
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
if ! git submodule update --init --recursive; then
|
||||
git submodule foreach --quiet --recursive \
|
||||
"git config --local remote.origin.url | grep -e ornicar -e lichess \
|
||||
&& git fetch origin +refs/pull/*/head:refs/remotes/origin/pr/* || :"
|
||||
git submodule update --recursive --init
|
||||
fi
|
Loading…
Reference in New Issue