2022-08-22 13:17:29 +05:30
|
|
|
define run_migrations ## run migrations
|
|
|
|
@ . ./venv/bin/activate && python manage.py makemigrations
|
|
|
|
@ . ./venv/bin/activate && python manage.py migrate
|
|
|
|
endef
|
|
|
|
|
|
|
|
default: ## Run app
|
|
|
|
$(call run_migrations)
|
|
|
|
. ./venv/bin/activate && python manage.py runserver
|
|
|
|
|
|
|
|
coverage: ## Generate test coverage report
|
|
|
|
. ./venv/bin/activate && coverage run manage.py test
|
|
|
|
. ./venv/bin/activate && coverage report -m
|
|
|
|
. ./venv/bin/activate && coverage html
|
|
|
|
|
2022-08-22 14:19:14 +05:30
|
|
|
docker: ## Build Docker image
|
|
|
|
docker build -t realaravinth/mystiq-sso:master -t realaravinth/mystiq-sso:latest .
|
|
|
|
|
|
|
|
docker-publish: docker ## Build and publish Docker image
|
|
|
|
docker push realaravinth/mystiq-sso:master
|
|
|
|
docker push realaravinth/mystiq-sso:latest
|
|
|
|
|
|
|
|
env: ## setup environment
|
|
|
|
@-virtualenv venv
|
|
|
|
. ./venv/bin/activate && pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
2022-08-22 13:17:29 +05:30
|
|
|
freeze: ## Freeze python dependencies
|
|
|
|
@. ./venv/bin/activate && pip freeze > 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}'
|
|
|
|
|
|
|
|
lint: ## Run linter
|
2022-08-22 13:18:15 +05:30
|
|
|
@./venv/bin/black accounts sso
|
2022-08-22 13:17:29 +05:30
|
|
|
|
|
|
|
migrate: ## Run migrations
|
|
|
|
$(call run_migrations)
|
|
|
|
|
|
|
|
test: ## Run tests
|
|
|
|
@. ./venv/bin/activate && python manage.py test --parallel
|