-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in-container
75 lines (53 loc) · 3.07 KB
/
Makefile.in-container
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
.PHONY: build-docs help mkdir-build
.DEFAULT_GOAL := help
# Building rules ----------------------------------------------------------------------------------
build-database: ## Migrate the application database (create or alter tables).
logan/manage.py migrate
build-initial-migrations: ## Create the initial database migrations.
logan/manage.py makemigrations logan
build-superuser: ## Create a super user in the application database.
logan/manage.py createsuperuser
build-docs: ## Build the documentation.
sphinx-build -E -b html docs build/docs
# Running rules -----------------------------------------------------------------------------------
python: ## Launch a Python shell in the djangoapp container.
logan/manage.py shell_plus
# Updating rules ----------------------------------------------------------------------------------
load-fixtures: ## Install the fixtures in the database.
./scripts/load_fixtures
update-migrations: ## Update the database migrations.
logan/manage.py makemigrations
create-data-migration: ## Create a new, empty data migration.
logan/manage.py makemigrations --empty $(APP)
reset-migrations: delete-migrations build-initial-migrations ## Delete all migrations and re-create the initial migrations.
# Backup rules ------------------------------------------------------------------------------------
backup-databases: ## Backup the databases.
logan/manage.py backup_databases
# Testing / Linting rules -------------------------------------------------------------------------
check: check-safety check-bandit check-pylint check-isort check-docs-links check-docs-spelling ## Run the check jobs (safety, style, docs).
mkdir-build:
@mkdir build 2>/dev/null || true
pytest: | mkdir-build ## Run the test suite.
pytest -c config/pytest.conf --cov --cov-config=config/coverage.conf --cov-report=term-missing -vv runtests.py tests
coverage combine --rcfile=config/coverage.conf --append || true
coverage html --rcfile=config/coverage.conf
check-safety: ## Run safety on the dependencies.
safety check --full-report
check-bandit: ## Run bandit on the code.
bandit -r logan
check-pylint: ## Run pylint on the code.
pylint --rcfile=config/pylint.conf logan tests
isort: ## Run isort (write files) on the code.
isort --settings-path=config --apply --recursive logan tests
check-isort: ## Run isort check on the code.
isort --settings-path=config --check-only --recursive logan tests
check-docs-links: build-docs ## Check the documentation (spelling, URLs).
sphinx-build -b linkcheck -w /dev/null docs dist/docs
check-docs-spelling: build-docs ## Check the documentation (spelling, URLs).
SPELLCHECK=1 sphinx-build -b spelling -w /dev/null docs dist/docs
# CLean rules -------------------------------------------------------------------------------------
delete-migrations: ## Delete the migrations.
@rm -rf logan/logan/migrations
# Usage rules -------------------------------------------------------------------------------------
help: ## Print this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort