version: '3'
env:
BE_BASE_PATH: "/{{ .TASKFILE_DIR }}/backend"
VENV_PATH: "{{ .BE_BASE_PATH }}/.venv"
VENV_BIN: "{{ .VENV_PATH }}/bin"
VENV_ACTIVATE: "{{ .VENV_BIN }}/activate"
DOTENV: "{{ .BASE_PATH }}/.env"
tasks:
bootstrap:
internal: true
cmds:
- . script/bootstrap
sources:
- "{{ .BE_BASE_PATH }}/*.in"
generates:
- "{{ .VENV_PATH }}/*"
dir: backend
lint:
desc: "Lints /backend using black + pylint."
deps: [bootstrap]
- "{{ .VENV_BIN }}/black . --check"
- "{{ .VENV_BIN }}/pylint ./rotini"
lintfix:
desc: "Lints and fixes /backend using black + pylint."
- "{{ .VENV_BIN }}/black ."
test:
desc: "Run the test suites."
cmd: . script/test
start:
desc: "Starts the backend application."
deps: [docker-build]
cmd: docker run -d -p 8000:8000 --name rotini_app {{ .CLI_ARGS }} rotini:dev
dir: backend/rotini
start-db:
desc: "Provisions a local Postgres database."
dotenv:
- "{{ .DOTENV }}"
cmd: . script/provision-db
migrate:
desc: "Applies migrations. Usage: be:migrate -- <up|down>"
PYTHONPATH: '..'
cmd: "{{ .VENV_BIN }}/python migrate.py {{ .CLI_ARGS }}"
dir: backend/rotini/migrations
lock-deps:
desc: "Locks production and development dependencies"
cmd: . script/requirements-lock
docker-build:
desc: "Builds a docker image from /backend"
cmd: docker build --build-arg PYTHON_VERSION=$(cat .python-version) -t rotini:dev .