forked from fake-name/xA-Scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_web.sh
46 lines (35 loc) · 1.03 KB
/
run_web.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
# Halt on errors.
set -e
# # This is just a very minimal script that starts the scraper.
# echo "Updating local git repo"
# git fetch --all
# git pull
# echo "Available branches:"
# git --no-pager branch -a | cat
# echo "Current release:"
# git --no-pager log -1 | cat
if [ -d "venv" ]
then
echo "Venv exists. Activating!"
source venv/bin/activate
else
echo "No Venv! Checking dependencies are installed."
sudo apt-get install build-essential -y
sudo apt-get install libxml2 libxslt1-dev python3-dev libz-dev -y
echo "Creating venv."
python3 -m venv --without-pip venv
wget https://bootstrap.pypa.io/get-pip.py
./venv/bin/python3 get-pip.py
rm get-pip.py
source venv/bin/activate
./venv/bin/pip install requests
fi;
echo "Checking dependencies are up-to-date."
./venv/bin/pip install --upgrade -r requirements.txt
echo "Checking database is up-to-date."
python3 db_migrate.py db upgrade
echo "Checking namelist for duplicates."
python3 -m manage name-clean
echo "Launching executable."
python3 ./main_web.py