Marc Cataford
1554e23e7f
* docs: document running as a container * build: functional dockerfile * build: task command tweaks to accommodate docker app * ci(backend): optionally build dev docker image
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
version: '3'
|
|
|
|
env:
|
|
VENV_PATH: "/{{ .TASKFILE_DIR }}/backend/.venv"
|
|
VENV_BIN: "{{ .VENV_PATH }}/bin"
|
|
VENV_ACTIVATE: "{{ .VENV_BIN }}/activate"
|
|
DOTENV: "/{{ .TASKFILE_DIR }}/backend/.env"
|
|
|
|
tasks:
|
|
bootstrap:
|
|
internal: true
|
|
cmds:
|
|
- . script/bootstrap
|
|
dir: backend
|
|
lint:
|
|
desc: "Lints /backend using black + pylint."
|
|
deps: [bootstrap]
|
|
cmds:
|
|
- "{{ .VENV_BIN }}/black . --check"
|
|
- "{{ .VENV_BIN }}/pylint ./rotini"
|
|
dir: backend
|
|
lintfix:
|
|
desc: "Lints and fixes /backend using black + pylint."
|
|
deps: [bootstrap]
|
|
cmds:
|
|
- "{{ .VENV_BIN }}/black ."
|
|
- "{{ .VENV_BIN }}/pylint ./rotini"
|
|
dir: backend
|
|
test:
|
|
desc: "Run the test suites."
|
|
deps: [bootstrap]
|
|
cmd: . script/test
|
|
dir: backend
|
|
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
|
|
dir: backend
|
|
migrate:
|
|
desc: "Applies migrations. Usage: be:migrate -- <up|down>"
|
|
deps: [bootstrap]
|
|
env:
|
|
PYTHONPATH: '..'
|
|
dotenv:
|
|
- "{{ .DOTENV }}"
|
|
cmd: "{{ .VENV_BIN }}/python migrate.py {{ .CLI_ARGS }}"
|
|
dir: backend/rotini/migrations
|
|
lock-deps:
|
|
desc: "Locks production and development dependencies"
|
|
deps: [bootstrap]
|
|
cmd: . script/requirements-lock
|
|
dir: backend
|
|
docker-build:
|
|
desc: "Builds a docker image from /backend"
|
|
cmd: docker build --build-arg PYTHON_VERSION=$(cat .python-version) -t rotini:dev .
|
|
dir: backend
|