Commit de5a1db9 by Bruno Bzeznik

Interface ok, login Nok

parent a3ae47ea
......@@ -18,6 +18,8 @@
sass
traceroute
git
wget
unzip
(python36.withPackages(ps: with ps; [pip virtualenv psycopg2 urllib3 requests]))
];
......
#!/usr/bin/env bash
LIB_DIR=/var/lib
PHYLODB_DIR=$LIB_DIR/phyloalps/phylodb
# Config
echo 'GEOS_LIBRARY_PATH = "/run/current-system/sw/lib/libgeos_c.so"' >> /var/lib/phyloalps/phylodb/phylodb/settings.py
echo 'GDAL_LIBRARY_PATH = "/run/current-system/sw/lib/libgdal.so"' >> /var/lib/phyloalps/phylodb/phylodb/settings.py
echo 'GEOS_LIBRARY_PATH = "/run/current-system/sw/lib/libgeos_c.so"' >> $PHYLODB_DIR/phylodb/settings.py
echo 'GDAL_LIBRARY_PATH = "/run/current-system/sw/lib/libgdal.so"' >> $PHYLODB_DIR/phylodb/settings.py
# Django install
cd /var/lib/django
cd $LIB_DIR/django
virtualenv -p python3 phylodbenv
source phylodbenv/bin/activate
pip install django
......@@ -20,7 +23,7 @@ sudo -u postgres psql -d editor_db -c "CREATE EXTENSION IF NOT EXISTS postgis"
sudo -u postgres psql -d browser_db -c "CREATE EXTENSION IF NOT EXISTS postgis"
# Create the databases schema
cd /var/lib/phyloalps/phylodb
cd $PHYLODB_DIR
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py migrate --database=browser_db
......@@ -43,11 +46,20 @@ sudo -u phyloalps python3 install/load_sampling_data.py $latest_sample editor_db
#sudo -u phyloalps python3 install/load_genomic_data.py browser_db phylobrowser
#sudo -u phyloalps python3 install/load_genomic_data.py editor_db phyloeditor
# Download the project dependencies
cd phylodb/static/deps
source deps.sh
# Generate CSS files from SASS files
cd $PHYLODB_DIR
sass phylobrowser/static/sass/browser.sass phylobrowser/static/css/browser.css
sass phyloeditor/static/sass/editor.sass phyloeditor/static/css/editor.css
sass phylohome/static/sass/home.sass phylohome/static/css/home.css
# Copy static files and grant permissions to httpd
python3 manage.py collectstatic
chown -R wwwrun:wwwrun /var/lib/phyloalps/phylodb/static
chmod -R 775 /var/lib/phyloalps/phylodb/static
chown -R wwwrun:wwwrun $PHYLODB_DIR/static
chmod -R 775 $PHYLODB_DIR/static
# Start Gunicon WSGI server on port 8888
nohup gunicorn -b :8888 phylodb.wsgi&
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment