Skip to content

Commit

Permalink
Add deploy script for app module
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed May 22, 2024
1 parent 9558597 commit 5fc3651
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions bin/deploy-v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

REMOTE=$1
REMOTE_DIR="/home/lila-search-v3"

echo "Deploy to server $REMOTE:$REMOTE_DIR"

sbt ";app/stage;exit"
if [ $? != 0 ]; then
echo "Deploy canceled"
exit 1
fi

RSYNC_OPTIONS=" \
--archive \
--no-o --no-g \
--force \
--delete \
--progress \
--compress \
--checksum \
--verbose \
--exclude RUNNING_PID \
--exclude '.git/'"

stage="modules/app/target/universal/stage"
include="bin $stage/bin $stage/lib"
rsync_command="rsync $RSYNC_OPTIONS $include $REMOTE:$REMOTE_DIR"
echo "$rsync_command"
$rsync_command
echo "rsync complete"

read -n 1 -p "Press [Enter] to continue."

echo "Restart lila-search-v3"
ssh $REMOTE "systemctl restart lichess-search-v3"

echo "Deploy complete"

0 comments on commit 5fc3651

Please sign in to comment.