2022-04-19 17:17:27 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-06-21 20:02:25 +00:00
|
|
|
set -euo pipefail
|
2019-02-13 19:37:07 +00:00
|
|
|
# A simple file to run all instructions from the README
|
|
|
|
## this should be run in the root of the repository
|
2019-04-01 21:42:59 +00:00
|
|
|
|
2019-04-04 23:48:59 +00:00
|
|
|
bold=$(tput bold)
|
|
|
|
normal=$(tput sgr0)
|
|
|
|
|
|
|
|
B="\n${bold}"
|
|
|
|
E="${normal}"
|
|
|
|
|
2019-04-04 23:25:30 +00:00
|
|
|
if [ ! -d "venv" ]; then
|
2022-04-19 17:57:27 +00:00
|
|
|
PYTHON_VERSION=$(cat .python-version)
|
|
|
|
echo -e "${B} No venv found, creating a new one with version ${PYTHON_VERSION} ${E}"
|
2022-04-19 18:19:23 +00:00
|
|
|
python3 -m virtualenv -p $PYTHON_VERSION venv
|
2019-04-01 21:42:59 +00:00
|
|
|
fi
|
2019-04-04 23:25:30 +00:00
|
|
|
source venv/bin/activate
|
|
|
|
|
2019-04-04 23:48:59 +00:00
|
|
|
|
|
|
|
echo -e "${B} Installing pip-tools ${E}"
|
2019-04-04 23:29:48 +00:00
|
|
|
pip install pip-tools
|
|
|
|
|
2019-04-04 23:48:59 +00:00
|
|
|
echo -e "${B} Downloading dependencies ${E}"
|
2019-04-04 23:25:30 +00:00
|
|
|
pip-sync
|
|
|
|
|
2020-07-17 09:10:05 +00:00
|
|
|
if [ ! -f app/config.py ]; then
|
|
|
|
echo -e "${B} Copying config template. All custom config options can be set in the config.py file ${E}"
|
|
|
|
cp app/config.example.py app/config.py
|
|
|
|
else
|
|
|
|
echo -e "${B} Found existing config.py, not copying config teplate ${E}"
|
|
|
|
fi
|
2019-04-04 23:25:30 +00:00
|
|
|
|
2019-04-04 23:48:59 +00:00
|
|
|
echo -e "${B} Seeding database ${E}"
|
2019-04-04 23:25:30 +00:00
|
|
|
./populate-db.sh
|
|
|
|
|
2020-12-04 19:21:12 +00:00
|
|
|
if [ ! -d "menus" ]; then
|
|
|
|
echo -en "${B} Do you want to use the Zeus HLDS menus? If not, you will have to clone your own menu repository. (Y/n) ${E}"
|
|
|
|
read confirm
|
|
|
|
if [ "$confirm" = n ]; then
|
|
|
|
echo "Not cloning the Zeus HLDS menus"
|
|
|
|
else
|
|
|
|
git clone https://git.zeus.gent/haldis/menus.git
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-07-17 09:06:27 +00:00
|
|
|
echo -e "${B} Activate your venv using 'source venv/bin/activate'.\nThen run the development server with 'python app/app.py runserver' ${E}"
|