feat: setup CI
parent
5482c1da86
commit
970ad61748
@ -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,41 @@
|
||||
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 ./payments/*
|
||||
@./venv/bin/black ./billing/*
|
||||
|
||||
migrate: ## Run migrations
|
||||
$(call run_migrations)
|
||||
|
||||
test: ## Run tests
|
||||
@. ./venv/bin/activate && python manage.py test
|
@ -1,18 +1,23 @@
|
||||
asgiref==3.5.0
|
||||
astroid==2.9.3
|
||||
black==22.1.0
|
||||
click==8.0.4
|
||||
Django==4.0.3
|
||||
django-environ==0.8.1
|
||||
greenlet==1.1.2
|
||||
isort==5.10.1
|
||||
jedi==0.18.1
|
||||
lazy-object-proxy==1.7.1
|
||||
mccabe==0.6.1
|
||||
msgpack==1.0.3
|
||||
mypy-extensions==0.4.3
|
||||
parso==0.8.3
|
||||
pika==1.2.0
|
||||
pathspec==0.9.0
|
||||
platformdirs==2.5.1
|
||||
psycopg2==2.9.3
|
||||
pylint==2.12.2
|
||||
pynvim==0.4.3
|
||||
sqlparse==0.4.2
|
||||
toml==0.10.2
|
||||
tomli==2.0.1
|
||||
wrapt==1.13.3
|
||||
|
Loading…
Reference in New Issue