forked from bloodcurdle/xA-Scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
41 lines (31 loc) · 892 Bytes
/
run.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
#!/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
./venv/bin/pip install --upgrade -r requirements.txt
fi;
echo "Launching executable."
python3 db_migrate.py db upgrade
python3 ./main.py