forked from alephdata/aleph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
123 lines (90 loc) · 2.95 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
COMPOSE=docker-compose -f docker-compose.dev.yml
COMPOSE_E2E=docker-compose -f docker-compose.dev.yml -f docker-compose.e2e.yml
APPDOCKER=$(COMPOSE) run --rm app
UIDOCKER=$(COMPOSE) run --no-deps --rm ui
ALEPH_TAG=latest
all: build upgrade web
services:
$(COMPOSE) up -d --remove-orphans \
postgres elasticsearch ingest-file
shell: services
$(APPDOCKER) /bin/bash
# To run a single test file:
# make test file=aleph/tests/test_manage.py
test:
$(APPDOCKER) contrib/test.sh $(file)
test-ui:
$(UIDOCKER) npm run test
lint:
ruff check .
lint-ui:
$(UIDOCKER) npm run lint
format:
black aleph/
format-ui:
$(UIDOCKER) npm run format
format-check:
black --check aleph/
format-check-ui:
$(UIDOCKER) npm run format:check
upgrade: build
$(COMPOSE) up -d postgres elasticsearch
sleep 10
$(APPDOCKER) aleph upgrade
api: services
$(COMPOSE) up --abort-on-container-exit api
web: services
$(COMPOSE) up api ui
worker: services
$(COMPOSE) run -p 127.0.0.1:5679:5679 --rm app python3 -m debugpy --listen 0.0.0.0:5679 -c "from aleph.manage import cli; cli()" worker
tail:
$(COMPOSE) logs -f
stop:
$(COMPOSE) down --remove-orphans
clean:
rm -rf dist build .eggs ui/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 {} \+
find ui/src -name '*.css' -exec rm -f {} +
build:
$(COMPOSE) build
build-ui:
docker build -t ghcr.io/alephdata/aleph-ui-production:$(ALEPH_TAG) -f ui/Dockerfile.production ui
build-e2e:
$(COMPOSE_E2E) build
build-full: build build-ui build-e2e
ingest-restart:
$(COMPOSE) up -d --no-deps --remove-orphans --force-recreate ingest-file
dev:
python3 -m pip install --upgrade pip
python3 -m pip install -q -r requirements.txt
python3 -m pip install -q -r requirements-dev.txt
fixtures:
aleph crawldir --wait -f fixtures aleph/tests/fixtures/samples
balkhash iterate -d fixtures >aleph/tests/fixtures/samples.ijson
# pybabel init -i aleph/translations/messages.pot -d aleph/translations -l de -D aleph
translate: dev
npm run --prefix ui messages
pybabel extract -F babel.cfg -k lazy_gettext -o aleph/translations/messages.pot aleph
tx push --source
tx pull -a -f
npm run --prefix ui translate
pybabel compile -d aleph/translations -D aleph -f
e2e/test-results:
mkdir -p e2e/test-results
services-e2e:
$(COMPOSE_E2E) up -d --remove-orphans \
postgres elasticsearch ingest-file \
e2e: services-e2e e2e/test-results
$(COMPOSE_E2E) run --rm app aleph upgrade
$(COMPOSE_E2E) run --rm app aleph createuser --name="E2E Admin" --admin --password="admin" [email protected]
$(COMPOSE_E2E) up -d api ui worker
BASE_URL=http://ui:8080 $(COMPOSE_E2E) run --rm e2e pytest -s -v --output=/e2e/test-results/ --screenshot=only-on-failure --video=retain-on-failure e2e/
e2e-local-setup: dev
playwright install
e2e-local:
pytest -s -v --screenshot only-on-failure e2e/
.PHONY: build services e2e