-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (38 loc) · 1012 Bytes
/
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
IMAGE_NAME = "pb2020-content-reader"
READER_MODE = "default"
READER_MODE_REDDIT = "reddit"
READER_MODE_TWITTER = "twitter"
READER_MODE_FORM = "form"
JOB_SLEEP_TIME_SECONDS="30"
REGISTRY_NAME=$(shell grep REGISTRY_NAME .env | cut -d "=" -f2)
IMAGE_PATH = /pb2020/crawlers
azure_login:
az acr login --name $(REGISTRY_NAME)
build:
docker build --rm \
--tag=$(IMAGE_NAME) \
.
run:
$(MAKE) build
docker run -it \
-v=$(CURDIR):/rss_feeds \
-e READER_MODE=$(READER_MODE) \
-e JOB_SLEEP_TIME_SECONDS=$(JOB_SLEEP_TIME_SECONDS) \
$(IMAGE_NAME) \
$(cmd)
run_reddit:
$(MAKE) build
$(MAKE) run READER_MODE=$(READER_MODE_REDDIT)
run_twitter:
$(MAKE) build
$(MAKE) run READER_MODE=$(READER_MODE_TWITTER)
run_form:
$(MAKE) build
$(MAKE) run READER_MODE=$(READER_MODE_FORM)
unit:
$(MAKE) build
$(MAKE) run cmd="python -m pytest ./tests/unit/"
# Pass in tag an manually increment
push:
$(MAKE) build IMAGE_NAME=$(REGISTRY_NAME)$(IMAGE_PATH):$(TAG)
docker push $(REGISTRY_NAME)$(IMAGE_PATH):$(TAG)