forked from bretttjohnson1/EmojiFi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (65 loc) · 1.9 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
SHELL:=/bin/bash
run:
( \
source venv/bin/activate; \
python emojifi_site/manage.py runserver 0:8000; \
)
run-bot:
( \
source venv/bin/activate; \
python reddit_bot/redditbot.py; \
)
test:
( \
source venv/bin/activate; \
pytest emoji_search/; \
)
#Sets up the full project on dev. Call setup-aws if on aws instead.
setup-project: install-python-packages nltk migrate index-data collect-static
install-python-packages:
python3.6 -m venv venv
( \
source venv/bin/activate; \
pip install -r requirements.txt; \
pip install -e emoji_search/ \
)
nltk:
sudo ./install_nltk.bash
migrate:
( \
source venv/bin/activate; \
emojifi_site/manage.py migrate; \
)
collect-static:
( \
source venv/bin/activate; \
python emojifi_site/manage.py collectstatic --no-input; \
)
index-data:
( \
source venv/bin/activate; \
python emoji_search/emojisearch/generate_emoji_search_files.py; \
python emoji_search/emojisearch/create_whoosh_index.py; \
)
#Aws specific build. Should not be called in debug
setup-aws: setup-project install-packages-aws link-configs-aws configure-permissions-aws
install-packages-aws:
sudo apt update
sudo apt install python3-pip -y
sudo pip3 install uwsgi
sudo apt-get install build-essential python3-dev -y
sudo apt-get install -y nginx
sudo apt-get install -y supervisor
link-configs-aws:
sudo ln -s -f /home/ubuntu/EmojiFi/config/emojifi_nginx.conf /etc/nginx/sites-enabled/
sudo mkdir -p /etc/uwsgi/vassals/
sudo ln -s -f /home/ubuntu/EmojiFi/config/emojifi_uwsgi.ini /etc/uwsgi/vassals/
sudo ln -s -f /home/ubuntu/EmojiFi/config/uwsgi_supervisord.conf /etc/supervisor/conf.d/
sudo ln -s -f /home/ubuntu/EmojiFi/config/reddit_bot_supervisord.conf /etc/supervisor/conf.d/
configure-permissions-aws:
sudo chgrp -R www-data /home/ubuntu/EmojiFi/
sudo chmod -R g+rw /home/ubuntu/EmojiFi/
sudo usermod -a -G www-data ubuntu
clean:
rm -rf venv/
rm -rf *.egg-info