-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (58 loc) · 1.76 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
DOCKER_IMAGE_NAME=carggregator-image
IMAGE_NAME=${DOCKER_IMAGE_NAME}:dev
build:
DOCKER_BUILDKIT=1 docker build \
--build-arg USER_NAME=user \
--build-arg USER_UID=$(shell id -u) \
--build-arg USER_GID=$(shell id -g) \
-f devops/Dockerfile \
-t ${IMAGE_NAME} .
shell: build
docker run -it --rm \
-v $(shell pwd)/src:/app \
--entrypoint /bin/bash \
--network host \
${IMAGE_NAME}
black: build
docker run -it --rm \
-v $(shell pwd)/src:/app \
${IMAGE_NAME} black /app
up: build
(cd devops && docker compose up -d)
devops/create_index.sh
up/minimal: build
(cd devops && docker compose up -d elasticsearch)
devops/create_index.sh
down:
(cd devops && docker compose down)
down/remove:
(cd devops && docker compose down -v)
# Default value for CLOSESPIDER_ITEMCOUNT
items=0
DATE=$(LOGPATH)$(shell date).json
crawl-motor.es:
docker run -it --rm \
--network host \
-v $(shell pwd):/app \
${IMAGE_NAME} bash -c 'cd src && scrapy crawl motor.es \
-s CLOSESPIDER_ITEMCOUNT=$(items) \
-o ../crawling_results/motor_es/$(LOGPATH)$(shell date +%Y_%m_%d__%H_%M_%S).json'
crawl-autoscout24:
docker run -it --rm \
--network host \
-v $(shell pwd):/app \
${IMAGE_NAME} bash -c 'cd src && scrapy crawl autoscout24 \
-s CLOSESPIDER_ITEMCOUNT=$(items) \
-o ../crawling_results/autoscout24/$(LOGPATH)$(shell date +%Y_%m_%d__%H_%M_%S).json'
crawl-autocasion:
docker run -it --rm \
--network host \
-v $(shell pwd):/app \
${IMAGE_NAME} bash -c 'cd src && scrapy crawl autocasion \
-s CLOSESPIDER_ITEMCOUNT=$(items) \
-o ../crawling_results/autocasion/$(LOGPATH)$(shell date +%Y_%m_%d__%H_%M_%S).json'
crawl-all: crawl-motor.es crawl-autoscout24 crawl-autocasion
demo:
devops/demo_script.sh
update:
git submodule update --init --recursive