forked from okfn-brasil/querido-diario
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 1.05 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
setup:
cp .env.example .env
docker-compose pull
docker-compose build
make seed
@if [ -z $$VIRTUAL_ENV ]; then \
pip install --user pre-commit; \
else \
pip install pre-commit; \
fi
pre-commit install
seed:
docker-compose up -d postgres
docker-compose run --rm processing bash seed.sh
test:
docker-compose run --rm processing black . --check
run_spider:
docker-compose run --rm processing bash -c "cd data_collection && scrapy crawl $(SPIDER)"
sql:
docker-compose run --rm postgres psql --username gazette -h postgres -W
clean:
find data/full/ -delete
build:
docker build -t $(NAMESPACE)/diario-oficial:$(shell date --rfc-3339=date --utc) -t $(NAMESPACE)/diario-oficial:latest processing
publish:
docker push $(NAMESPACE)/diario-oficial:$(shell date --rfc-3339=date --utc)
docker push $(NAMESPACE)/diario-oficial:latest
shell:
docker-compose run --rm processing bash -c "cd data_collection && scrapy shell"
run_spider_since:
docker-compose run --rm processing bash -c "cd data_collection && scrapy crawl -a start_date=$(START_DATE) $(SPIDER)"