-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 1013 Bytes
/
Makefile
File metadata and controls
43 lines (32 loc) · 1013 Bytes
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
init:
pip install -e ".[dev]"
build:
python -m build
format:
ruff check --select I --fix arabterm
ruff format arabterm
init_mariadb:
@if [ $$(docker ps -a -q -f name=mariadb) ]; then \
docker start mariadb; \
else \
docker run -d --name mariadb \
-e MARIADB_DATABASE=arabterm \
-e MARIADB_ROOT_PASSWORD=${MARIADB_PASSWORD} \
-e MARIADB_USER=arabterm \
-p 3306:3306 mariadb:11.8; \
fi
delete_mariadb:
python arabterm/scripts/delete_mariadb.py
migrate_to_mariadb:
python arabterm/scripts/migrate_to_mariadb.py
# Usage: make search_mariadb term="telescope"
search_mariadb:
python arabterm/scripts/search_mariadb.py $(term)
dump_sqlite:
sqlite3 arabterm.db ".output db/sqlite/arabterm.sql" .dump
gzip --force db/sqlite/arabterm.sql
dump_mariadb:
docker exec mariadb sh -c "mariadb-dump --password=${MARIADB_PASSWORD} arabterm > /mnt/arabterm.sql"
docker cp mariadb:/mnt/arabterm.sql db/mariadb/arabterm.sql
gzip --force db/mariadb/arabterm.sql
dump: dump_sqlite dump_mariadb