-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
deploy.sh
executable file
·40 lines (30 loc) · 762 Bytes
/
deploy.sh
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
#!/bin/sh
REMOTE=$1
REMOTE_DIR="/home/lila-fishnet"
echo "Deploy to server $REMOTE:$REMOTE_DIR"
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 RUNNING_PID \
--exclude '.git/'"
stage="app/target/universal/stage"
include="$stage/bin $stage/kanela-agent $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-fishnet"
ssh $REMOTE "chown -R lila-fishnet:lila-fishnet /home/lila-fishnet && systemctl restart lila-fishnet"
echo "Deploy complete"