forked from lichess-org/lila-ws
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·41 lines (31 loc) · 717 Bytes
/
deploy.sh
File metadata and controls
executable file
·41 lines (31 loc) · 717 Bytes
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
#!/bin/sh
APP=lila-ws-2.0
REMOTE=$1
REMOTE_DIR="/home/lila-ws"
stage="target/universal/stage"
echo "Deploy $APP to server $REMOTE:$REMOTE_DIR"
rm -rf $stage
sbt stage
if [ $? != 0 ]; then
echo "Deploy canceled"
exit 1
fi
RSYNC_OPTIONS=" \
--archive \
--no-o --no-g \
--force \
--delete \
--progress \
--compress \
--checksum \
--verbose \
--exclude '.git/'"
include="$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-ws"
ssh $REMOTE "chown -R lila-ws:lila-ws /home/lila-ws && systemctl restart lila-ws"
echo "Deploy complete"