init CI
parent
82b57d5c87
commit
c93af38aa3
|
@ -0,0 +1,16 @@
|
||||||
|
pipeline:
|
||||||
|
backend:
|
||||||
|
image: python
|
||||||
|
environment:
|
||||||
|
- DATABSE_URL=postgres://postgres:password@database:5432/postgres
|
||||||
|
commands:
|
||||||
|
- pip install virtualenv
|
||||||
|
- make env
|
||||||
|
- make lint
|
||||||
|
- make test
|
||||||
|
|
||||||
|
services:
|
||||||
|
database:
|
||||||
|
image: postgres
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=password
|
|
@ -0,0 +1,40 @@
|
||||||
|
define run_migrations ## run migrations
|
||||||
|
@ . ./venv/bin/activate && python manage.py makemigrations
|
||||||
|
@ . ./venv/bin/activate && python manage.py migrate
|
||||||
|
endef
|
||||||
|
|
||||||
|
define unimplemented
|
||||||
|
@echo "ERROR: Unimplemented!" && echo -1.
|
||||||
|
endef
|
||||||
|
|
||||||
|
default: ## Run app
|
||||||
|
$(call run_migrations)
|
||||||
|
. ./venv/bin/activate && python manage.py runserver
|
||||||
|
|
||||||
|
coverage: ## Generate test coverage report
|
||||||
|
$(call unimplemented)
|
||||||
|
|
||||||
|
doc: ## Generates documentation
|
||||||
|
$(call unimplemented)
|
||||||
|
|
||||||
|
docker: ## Build Docker image from source
|
||||||
|
$(call unimplemented)
|
||||||
|
|
||||||
|
env: ## Install all dependencies
|
||||||
|
@-virtualenv venv
|
||||||
|
. ./venv/bin/activate && pip install -r requirements.txt
|
||||||
|
|
||||||
|
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
|
||||||
|
@./venv/bin/black ./dashboard/*
|
||||||
|
|
||||||
|
migrate: ## Run migrations
|
||||||
|
$(call run_migrations)
|
||||||
|
|
||||||
|
test: ## Run tests
|
||||||
|
@. ./venv/bin/activate && python manage.py test
|
Loading…
Reference in New Issue