refactor(taskfiles): remove redundant paths and venv entries in backend taskfile

This commit is contained in:
Marc 2023-12-17 23:57:35 -05:00
parent c681c65c68
commit b5b8213be3
Signed by: marc
GPG key ID: 048E042F22B5DC79
2 changed files with 11 additions and 20 deletions

View file

@ -1,35 +1,29 @@
version: '3'
env:
BE_BASE_PATH: "/{{ .TASKFILE_DIR }}/backend"
VENV_PATH: "{{ .BE_BASE_PATH }}/.venv"
VENV_PATH: "{{ .TASKFILE_DIR }}/.venv"
VENV_BIN: "{{ .VENV_PATH }}/bin"
VENV_ACTIVATE: "{{ .VENV_BIN }}/activate"
DOTENV: "{{ .BE_BASE_PATH }}/.env"
APP_CONTAINER_NAME: "rotini_app"
DB_CONTAINER_NAME: "rotini_db"
tasks:
bootstrap:
internal: true
cmds:
- . script/bootstrap
cmd: . script/bootstrap
sources:
- "{{ .BE_BASE_PATH }}/pyproject.toml"
- ./pyproject.toml
generates:
- "{{ .VENV_PATH }}/*"
dir: backend
lint:
desc: "Checks /backend for linting and formatting problems."
deps: [bootstrap]
cmd: . script/format.sh
dir: backend
dotenv:
- ../backend-test.env
lintfix:
desc: "Resolves linting and formatting problems in /backend."
deps: [bootstrap]
cmd: . script/format.sh
dir: backend
env:
FIX: 1
dotenv:
@ -38,35 +32,30 @@ tasks:
desc: "Run the test suites."
deps: [bootstrap]
cmd: . script/test
dir: backend
dotenv:
- ../backend-test.env
start:
desc: "Starts the backend application."
deps: [build]
env:
APP_CONTAINER_NAME: "{{ .APP_CONTAINER_NAME }}"
cmd: . script/start.sh
dir: backend
dotenv:
- ../backend.env
stop:
desc: "Stops the backend application."
cmd: docker rm -f {{ .APP_CONTAINER_NAME }}
cmd: docker rm -f {{ .APP_CONTAINER_NAME }} {{ .DB_CONTAINER_NAME }}
logs:
desc: "Shortcut to Docker container logs"
cmd: docker logs {{ .APP_CONTAINER_NAME }} -f
start-db:
desc: "Provisions a local Postgres database."
dotenv:
- "{{ .DOTENV }}"
- ../backend.env
cmd: . script/provision-db
dir: backend
lock-deps:
desc: "Locks production and development dependencies"
deps: [bootstrap]
cmd: . script/requirements-lock
dir: backend
build:
desc: "Builds a docker image from /backend"
cmd: . script/build.sh
dir: backend

View file

@ -3,5 +3,7 @@ version: '3'
# See environment-specific taskfiles for commands about
# that environment.
includes:
be: ./Taskfile.backend.yml
be:
taskfile: ./Taskfile.backend.yml
dir: backend
fe: ./Taskfile.frontend.yml