-
Notifications
You must be signed in to change notification settings - Fork 15
/
first-setup.sh
executable file
·46 lines (36 loc) · 1.32 KB
/
first-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
#!/usr/bin/env bash
set -euo pipefail
# A simple file to run all instructions from the README
## this should be run in the root of the repository
bold=$(tput bold)
normal=$(tput sgr0)
B="\n${bold}"
E="${normal}"
if [ ! -d "venv" ]; then
PYTHON_VERSION=$(cat .python-version)
echo -e "${B} No venv found, creating a new one with version ${PYTHON_VERSION} ${E}"
python3 -m virtualenv -p "$PYTHON_VERSION" venv
fi
source venv/bin/activate
echo -e "${B} Installing pip-tools ${E}"
pip install poetry
echo -e "${B} Downloading dependencies ${E}"
poetry install
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
echo -e "${B} Seeding database ${E}"
./populate-db.sh
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
echo -e "${B} Activate your venv using 'source venv/bin/activate'.\nThen run the development server with 'flask run --port=8000 --debug' from within the app folder ${E}"