-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (66 loc) · 2.16 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
default: run
################################################################################
# Linting, formatting, typing, security checks, coverage
test:
python -m pytest --log-cli-level info -p no:warnings -v -s ./tests
cov:
pytest --cov=src --cov-report term-missing tests/
format:
python -m black -S --line-length 79 --diff --color --preview ./src
python -m black -S --line-length 79 --diff --color --preview ./tests
isort --profile black --line-length 79 ./src
isort --profile black --line-length 79 ./tests
type:
python -m mypy --no-implicit-reexport --ignore-missing-imports --no-namespace-packages ./src
lint:
python -m flake8 --ignore=E501,W503 ./src
python -m flake8 --ignore=E501,W503 ./tests
secu:
python -m bandit -rq ./src
ci: lint format type secu
################################################################################
# Application run
run:
python ./src/app.py
mongod:
mongod --dbpath .\data\mongodb
################################################################################
# Containers setup
# docker-spin-up:
# docker compose --env-file env up airflow-init && docker compose --env-file env up --build -d
# perms:
# mkdir -p logs plugins temp dags tests migrations && chmod -R u=rwx,g=rwx,o=rwx logs plugins temp dags tests migrations
# up: perms docker-spin-up warehouse-migration
run-mongo:
docker run --name mongo -p 27017:27017 -v .\data\mongodb:/data/db mongo:6.0.2
run-cron:
docker run -v ./src:/home/src --name cron cron:1.0.1
run-dash:
docker run -v ./src:/home/src --name dash dash:1.0.1
up:
docker compose up
down:
docker compose down
build:
docker image build . -t dash:1.0.1
docker image build . -f cron.Dockerfile -t cron:1.0.1
container-run:
docker container run -it -d --name dash dash:1.0.1
exec:
docker exec -it dash bash
exec-scratch: container-kill prune build container-run
docker exec -it dash bash
container-start:
docker container start dash
container-stop:
docker container stop dash
container-kill:
docker kill dash
container-killall:
docker kill $(docker ps -aq)
container-rmall:
docker rm -f $(docker ps -aq)
image-rmall:
docker rmi -f $(docker images -aq)
prune:
docker system prune -af