haldis/first-setup.sh

42 lines
1 KiB
Bash
Raw Normal View History

#!/bin/bash
2020-06-21 20:02:25 +00:00
set -euo pipefail
# A simple file to run all instructions from the README
## this should be run in the root of the repository
2019-04-04 23:48:59 +00:00
bold=$(tput bold)
normal=$(tput sgr0)
B="\n${bold}"
E="${normal}"
if [ ! -d "venv" ]; then
echo -e "${B} No venv found, creating a new one ${E}"
python3 -m venv venv
fi
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}"
pip-sync
2020-07-17 09:06:27 +00:00
echo -en "${B} Do you want to install support for the Airbrake API for error logging? If you don't have an Errbit server or Airbrake account, answer no. (y/N) ${E}"
read confirm
if [ "$confirm" = y ]; then
pip install airbrake
else
echo "Not installing airbrake"
fi
2019-04-04 23:48:59 +00:00
echo -e "${B} Copying config template. All custom config options can be set in the config.py file ${E}"
cd app
cp config.example.py config.py
cd ..
2019-04-04 23:48:59 +00:00
echo -e "${B} Seeding database ${E}"
./populate-db.sh
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}"