-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdeploy_local.sh
executable file
·82 lines (68 loc) · 2.54 KB
/
deploy_local.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
repo=`pwd`
target=$repo
if [ -f .inst_dir ] ; then
target=`cat .inst_dir`
fi
read -p "Installation directory: ${target}? (y/n)" response
if [ "$response" != "y" ] && [ "$response" != "Y" ] ; then
read -p "Type directory: " target
fi
read -p "Install Anfisa into ${target}? (y/n)" response
if [ "$response" != "y" ] && [ "$response" != "Y" ] ; then
echo "Installation aborted"
return 1 2> /dev/null || exit 1
fi
if [ $repo != $target ] ; then
echo Setting up $target
mkdir -p $target
cp $repo/anfisa.json $target
cp $repo/setup.py $target
cp $repo/README.md $target
cp -R $repo/app $target/
echo $target > .inst_dir
cd $target
else
echo "Installing into repository directory"
fi
[ ! -d "data" ] && mkdir data
[ ! -d "export/work" ] && mkdir -p export/work
[ ! -d "logs" ] && mkdir logs
[ ! -d "vault" ] && mkdir vault
rm vault/*
if [ ! -d data/docs ] ; then
cd data || exit
rm -r *
curl -O -L https://forome-dataset-public.s3.us-south.cloud-object-storage.appdomain.cloud/pgp3140_wgs_hlpanel.zip
unzip pgp3140_wgs_hlpanel.zip
cd ..
fi
if [ ! -f data/gene_db.js ] ; then
cd data || exit
curl -O -L https://forome-dataset-public.s3.us-south.cloud-object-storage.appdomain.cloud/gene_db.zip
unzip gene_db.zip
cd ..
fi
if [ ! -f export/SEQaBOO_output_template_20190317.xlsx ] ; then
cd export || exit
curl -O -L https://www.dropbox.com/s/4dvunn3dusqc636/SEQaBOO_output_template_20190317.xlsx
cd ..
fi
echo "Updating configuration in anfisa.json"
hostname=`hostname`
sed 's#/anfisa/a-setup#WOWOWOWO#' ${repo}/setup/anfisa.json.template \
| sed "s#WOWOWOWO#$target#" \
| sed "s#PATH_TO_SOURCE#$repo#" \
| sed "s/HOST_IP/127.0.0.1/" \
| sed "s/3041/8190/" > anfisa_$hostname.json
pip3 install wheel # apparently we need this before other requirements
pip3 install -e git+https://github.com/ForomePlatform/forome_misc_tools.git#egg=forome-tools
pip3 install -r ${repo}/requirements.txt
echo "Gene_db.js initialisation"
PYTHONPATH=$repo python3 -m app.adm_mongo -c $target/anfisa_$hostname.json -m GeneDb data/gene_db.js
echo "Loading Sample Dataset"
echo "PYTHONPATH=$repo python3 -u -m app.storage -c $target/anfisa_$hostname.json -m create -f -k ws -i data/pgp3140_wgs_hlpanel.cfg PGP3140"
PYTHONPATH=$repo python3 -u -m app.storage -c $target/anfisa_$hostname.json -m create -f -k ws -i data/pgp3140_wgs_hlpanel.cfg PGP3140
cd $repo || exit
echo "Run anfisa: env PYTHONPATH="." python3 app/run.py $target/anfisa_$hostname.json"
echo "Then point your browser to: http://localhost:8190/dir"