-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (65 loc) · 1.83 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
80
81
82
83
84
85
86
87
88
89
90
91
92
##
## DEV COMMANDS - FROM OUTSIDE CONTAINER
##
docker-dev-build:
cp requirements.txt docker/
docker-compose -f docker-compose-dev.yaml build
docker-dev-up:
docker-compose -f docker-compose-dev.yaml up -d
docker-dev-stop:
docker-compose -f docker-compose-dev.yaml stop
docker-dev-exec:
docker exec -it mediastrends-core-dev /bin/bash
docker-prod-build: package
docker-compose build
docker-prod-up:
docker-compose up -d
docker-prod-stop:
docker-compose stop
docker-prod-exec:
docker exec -it mediastrends-core-prod /bin/bash
package: .git/HEAD
python3 setup.py sdist bdist_wheel
touch package
##
## DEV COMMANDS - INSIDE CORE CONTAINER
##
install-dev:
pip install -e .
unittest:
python -m unittest discover -s tests
flake8:
flake8 mediastrends --count --statistics --ignore=E501,W503 --show-source
##
## PROD COMMANDS - INSIDE CORE CONTAINER
##
install-prod:
pip install .
## ----------------------------------------------------------------------------
##
## Makefile as a DAG
##
.DEFAULT_GOAL := get_movies_trends
SHELL:=bash
MD=mediastrends
LOG_FILE=logs/mediastrends_${MEDIASTRENDS_MODE}.txt
.PHONY := get_movie_trends
add_movie_torrents:
@python scripts/add_movie_torrents.py
@touch add_movie_torrents
stats_movie_torrents: add_movie_torrents
@python scripts/stats_movie_torrents.py
@touch stats_movie_torrents
compute_movie_trends: stats_movie_torrents
@${MD} -vvvvv torrents trends compute -c movies >> ${LOG_FILE} 2>&1 && \
${MD} -vvvvv torrents status -c movies >> ${LOG_FILE} 2>&1 && \
${MD} -vvvvv torrents trends get -c movies >> ${LOG_FILE} 2>&1 && \
${MD} -vvvvv movies compute >> ${LOG_FILE} 2>&1
@touch compute_movie_trends
get_movie_trends: compute_movie_trends
@${MD} -vvvvv movies get
clean:
@rm -f add_movie_torrents
@rm -f stats_movie_torrents
@rm -f compute_movie_trends
@echo "... cleaned"