From b5b8213be380635d45047d884b6e97c2fa8536a2 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sun, 17 Dec 2023 23:57:35 -0500 Subject: [PATCH] refactor(taskfiles): remove redundant paths and venv entries in backend taskfile --- Taskfile.backend.yml | 27 ++++++++------------------- Taskfile.yml | 4 +++- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Taskfile.backend.yml b/Taskfile.backend.yml index 7c7e27e..b3398e1 100644 --- a/Taskfile.backend.yml +++ b/Taskfile.backend.yml @@ -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 diff --git a/Taskfile.yml b/Taskfile.yml index f2f1775..ebdd8c6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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