forked from ohsu-comp-bio/g2p-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·53 lines (44 loc) · 1.18 KB
/
setup.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
echo install and configure app
#
echo checking docker compose alias
if [ `alias | grep dc | wc -l` != 1 ]; then
echo Please configure environmental variables
echo
echo e.g. for standalone development ...
cat <<EOT
alias dc='docker-compose -f docker-compose.yml'
export SERVER_NAME=g2p-ohsu.ddns.net
export [email protected]
EOT
echo
echo e.g. for cloud depoyment ...
cat <<EOT
alias dc='docker-compose -f docker-compose.yml -f cloud-setup/docker-compose-nginx.yml'
export SERVER_NAME=g2p-ohsu.ddns.net
export [email protected]
EOT
exit 1
fi
#
echo checking clone repo
if [ ! -d ~/g2p-aggregator ]; then
# clone repo
cd ~
git clone https://github.com/ohsu-comp-bio/g2p-aggregator.git
cd g2p-aggregator
cat <<EOT > .env
ELASTIC_PORT=9200
KIBANA_PORT=5601
EOT
fi
echo checking backup dir
if [ ! -d ~/g2p-aggregator/util/elastic/backups ]; then
echo copy snapshot back up to this host... e.g.
echo scp -r -i [your key] ~/g2p-aggregator/util/elastic/backups/ [user]@[host]:g2p-aggregator/util/elastic/backups
mkdir ~/g2p-aggregator/util/elastic/backups
fi
if [ -d ~/g2p-aggregator/util/elastic/backups ]; then
cd ~/g2p-aggregator
dc up -d
fi