-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
50 lines (39 loc) · 1.56 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
OPENAPI_DIST := northstar/static/docs/openapi
default: doc ## Run app
@. ./venv/bin/activate && python -m northstar
coverage:
@ . ./venv/bin/activate && coverage run -m pytest
@ . ./venv/bin/activate && coverage html
@ . ./venv/bin/activate && coverage xml
doc: ## Generate documentation
@-rm -rf $(OPENAPI_DIST)
@-mkdir -p $(OPENAPI_DIST)
@cd ./docs/openapi/ && yarn install && yarn html
@cp -r ./docs/openapi/dist/* $(OPENAPI_DIST)
docker: ## Build Docker image from source
docker build -t forgedfed/northstar .
env: ## Install all dependencies
@-virtualenv venv
. ./venv/bin/activate && pip install -r requirements.txt
. ./venv/bin/activate && pip install -e .
. ./venv/bin/activate && pip install '.[test]'
freeze: ## Freeze python dependencies
@. ./venv/bin/activate && pip freeze > requirements.txt
@-sed -i 's/northstar.*/.\//' requirements.txt
help: ## Prints help for targets with comments
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
i: ## Launch app.py in an interactive python shell
python -i ./northstar/__init__.py
lint: ## Run linter
@./venv/bin/black ./northstar/*
@./venv/bin/black ./tests/*
migrate: ## Run migrations
@- mkdir instance/
@ venv/bin/yoyo-migrate apply --all --batch
test: doc ## Run tests
@cd ./docs/openapi/ && yarn install
@cd ./docs/openapi/ && yarn test
@. ./venv/bin/activate && pip install -e .
@. ./venv/bin/activate && pip install '.[test]'
@ ENV_FOR_DYNACONF=testing ./venv/bin/pytest
@pip uninstall -y northstar