2019-02-13 20:37:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# A simple file to run all instructions from the README
|
|
|
|
## this should be run in the root of the repository
|
2019-04-01 23:42:59 +02:00
|
|
|
|
2019-04-05 01:48:59 +02:00
|
|
|
bold=$(tput bold)
|
|
|
|
normal=$(tput sgr0)
|
|
|
|
|
|
|
|
B="\n${bold}"
|
|
|
|
E="${normal}"
|
|
|
|
|
2019-04-05 01:25:30 +02:00
|
|
|
if [ ! -d "venv" ]; then
|
2019-04-05 01:48:59 +02:00
|
|
|
echo -e "${B} No venv found, creating a new one ${E}"
|
2019-05-31 01:07:01 +02:00
|
|
|
python3 -m venv venv
|
2019-04-01 23:42:59 +02:00
|
|
|
fi
|
2019-04-05 01:25:30 +02:00
|
|
|
source venv/bin/activate
|
|
|
|
|
2019-04-05 01:48:59 +02:00
|
|
|
|
|
|
|
echo -e "${B} Installing pip-tools ${E}"
|
2019-04-05 01:29:48 +02:00
|
|
|
pip install pip-tools
|
|
|
|
|
2019-04-05 01:48:59 +02:00
|
|
|
echo -e "${B} Downloading dependencies ${E}"
|
2019-04-05 01:25:30 +02:00
|
|
|
pip-sync
|
|
|
|
|
2019-04-05 01:48:59 +02:00
|
|
|
echo -e "${B} Copying config template. All custom config options can be set in the config.py file ${E}"
|
2019-02-13 20:37:07 +01:00
|
|
|
cd app
|
|
|
|
cp config.example.py config.py
|
|
|
|
cd ..
|
2019-04-05 01:25:30 +02:00
|
|
|
|
2019-04-05 01:48:59 +02:00
|
|
|
echo -e "${B} Seeding database ${E}"
|
2019-04-05 01:25:30 +02:00
|
|
|
./populate-db.sh
|
|
|
|
|
2019-04-05 01:48:59 +02:00
|
|
|
echo -e "${B} Activate your venv using 'source venv/bin/activate'.\nThen run the server with 'python app/haldis.py runserver' ${E}"
|