forked from alephdata/ingest-file
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (53 loc) · 1.93 KB
/
Makefile
File metadata and controls
74 lines (53 loc) · 1.93 KB
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
INGEST=ghcr.io/openaleph/ingest-file
INGEST=ghcr.io/openaleph/ingest-file
COMPOSE=docker compose
COMPOSE_E2E=docker compose -f docker-compose.e2e.yml
DOCKER=$(COMPOSE) run --rm ingest-file
IMAGE ?= ghcr.io/openaleph/ingest-file:latest
.PHONY: build
all: build shell
build:
$(COMPOSE) build --no-rm --parallel
build-base:
docker build . -f Dockerfile.base -t ghcr.io/openaleph/ingest-file-base:latest
build-cache:
docker build . --cache-from ghcr.io/openaleph/ingest-file:cache -t ghcr.io/openaleph/ingest-file:cache
build-test:
$(COMPOSE) build test-ingest-file
build-macos:
DOCKER_BUILDKIT=0 COMPOSE_DOCKER_CLI_BUILD=0 $(COMPOSE) build --no-rm --parallel
services:
$(COMPOSE) up -d --remove-orphans postgres redis
shell: services
$(DOCKER) /bin/bash
lint:
ruff check .
format:
black .
format-check:
black --check .
test: build-test services
PYTHONDEVMODE=1 PYTHONTRACEMALLOC=1 $(COMPOSE) run --rm test-ingest-file pytest
test-arm: services
DEBUG=1 PYTHONDEVMODE=1 PYTHONTRACEMALLOC=1 PROCRASTINATE_APP=ingestors.tasks.app docker run --rm -v ./tests:/ingestors/tests $(IMAGE) sh -c "cd /ingestors && pip3 install --no-deps -r /ingestors/requirements-dev.txt && pip3 install --no-cache-dir procrastinate==3.2.2 && chown -R app:app /ingestors && pytest"
test-e2e: build services
$(COMPOSE_E2E) run --rm ingest-file
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
documentation:
mkdocs build
aws --profile nbg1 --endpoint-url https://s3.investigativedata.org s3 sync ./site s3://openaleph.org/docs/lib/ingest-file