forked from oestrich/ex_venture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·38 lines (28 loc) · 743 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·38 lines (28 loc) · 743 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
set -e
TEMP=`getopt -o s --long seed -- "$@"`
eval set -- "$TEMP"
while true ; do
case "$1" in
-s|--seed)
echo "seeding";
seed=true;
shift ;;
--) shift ; break ;;
esac
done
host=$1
echo "Deploying to ${host}";
echo "Copying file"
scp _build/prod/rel/ex_venture/releases/0.28.0/ex_venture.tar.gz deploy@$host:
echo "Stopping ExVenture"
ssh deploy@$host 'sudo systemctl stop exventure'
echo "Un-taring"
ssh deploy@$host 'tar xzf ex_venture.tar.gz -C ex_venture'
echo "Migrating"
ssh deploy@$host './ex_venture/bin/ex_venture migrate'
if [ $seed ] ; then
echo "Seeding"
ssh deploy@$host './ex_venture/bin/ex_venture seed'
fi
echo "Starting ExVenture"
ssh deploy@$host 'sudo systemctl start exventure'