forked from alephdata/ingest-file
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (43 loc) · 1.19 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
INGEST=ghcr.io/alephdata/ingest-file
COMPOSE=docker-compose
DOCKER=$(COMPOSE) run --rm ingest-file
.PHONY: build
all: build shell
build:
$(COMPOSE) build --no-rm --parallel
pull-cache:
-docker pull -q $(INGEST):cache
cached-build: pull-cache
docker build --cache-from $(INGEST):cache -t $(INGEST) .
fresh-cache:
# re-generate cache images on a daily basis to avoid using
# stale docker containers from upstream.
docker build --pull --no-cache -t $(INGEST):cache .
services:
$(COMPOSE) up -d --remove-orphans postgres redis
shell: services
$(DOCKER) /bin/bash
lint:
ruff check .
format:
black .
format-check:
black --check .
test: services
$(DOCKER) pytest --cov=ingestors --cov-report html --cov-report term
restart: build
$(COMPOSE) up --force-recreate --no-deps --detach ingest-file
tail:
$(COMPOSE) logs -f
stop:
$(COMPOSE) down --remove-orphans
clean:
rm -rf dist build
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -type d -name __pycache__ -exec rm -r {} \+
dev:
python3 -m pip install --upgrade pip
python3 -m pip install -q -r requirements-dev.txt