-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (58 loc) · 1.79 KB
/
Makefile
File metadata and controls
77 lines (58 loc) · 1.79 KB
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
VENV = venv
PYTHON = .$(VENV)/bin/python3
PIP = .$(VENV)/bin/pip
BREW_INSTALL = "curl -SL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
activate:
. .$(VENV)/bin/activate
setup: requirements.txt
docker pull python
python3 -m $(VENV) .$(VENV)
. .$(VENV)/bin/activate
$(PIP) install --upgrade pip
$(PIP) install -r requirements.txt
install_redis:
ifeq ($(shell uname), Linux)
echo "intalling redis with apt --- UNTESTED ---"
apt install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install redis
endif
ifeq ($(shell uname), Darwin)
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) install_brew
echo "intalling redis with brew"
brew install redis
endif
install_xcode:
xcode-select --install
install_brew:
curl -S -o install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
http_start: activate
$(PYTHON) http_server.py &
http_stop: activate
$(PYTHON) http_server.py -1
http_restart: http_stop http_start
redis_start:
redis-server --daemonize yes --port 6379
redis-cli ping
redis_stop:
redis-cli shutdown
redis_restart: redis_stop redis_start
test_run: .env redis_start activate
$(PYTHON) http_server.py &
$(PYTHON) test.py
$(PYTHON) http_server.py -1
test_no_setup: redis_start activate test_run
test: setup install_redis test_no_setup
run: redis_start activate http_start
shutdown: http_stop redis_stop
clean:
rm -rf __pycache__
rm -rf util/__pycache__
rm -rf *.out
rm -rf logs/*
rm dump.rdb
containerize:
pip freeze > requirements.txt
tar cfzv assignment.tar.gz * .env