feat(Taskfile): add Docker build tasks and update Python environment setup to use Poetry
This commit is contained in:
38
Taskfile.yml
38
Taskfile.yml
@@ -25,6 +25,10 @@ vars:
|
|||||||
sh: echo "${DOCKER_CONTEXT:-.}"
|
sh: echo "${DOCKER_CONTEXT:-.}"
|
||||||
DOCKERFILE:
|
DOCKERFILE:
|
||||||
sh: echo "${DOCKERFILE:-Dockerfile}"
|
sh: echo "${DOCKERFILE:-Dockerfile}"
|
||||||
|
DOCKER_BUILD_IMAGE:
|
||||||
|
sh: echo "${DOCKER_BUILD_IMAGE:-reticulum-meshchatx-build:local}"
|
||||||
|
DOCKER_BUILD_FILE:
|
||||||
|
sh: echo "${DOCKER_BUILD_FILE:-Dockerfile.build}"
|
||||||
ANDROID_DIR:
|
ANDROID_DIR:
|
||||||
sh: echo "${ANDROID_DIR:-android}"
|
sh: echo "${ANDROID_DIR:-android}"
|
||||||
PYTHON_SRC_DIR:
|
PYTHON_SRC_DIR:
|
||||||
@@ -50,22 +54,17 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- task --list
|
- task --list
|
||||||
|
|
||||||
setup-uv:
|
|
||||||
desc: Install uv
|
|
||||||
cmds:
|
|
||||||
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
||||||
|
|
||||||
setup-python-env:
|
setup-python-env:
|
||||||
desc: Setup Python environment using uv
|
desc: Setup Python environment using Poetry
|
||||||
cmds:
|
cmds:
|
||||||
- uv venv
|
- poetry install
|
||||||
- uv pip install ruff poetry
|
- poetry run pip install ruff
|
||||||
|
|
||||||
lint-python:
|
lint-python:
|
||||||
desc: Lint Python code using ruff
|
desc: Lint Python code using ruff
|
||||||
cmds:
|
cmds:
|
||||||
- uv run ruff check .
|
- poetry run ruff check .
|
||||||
- uv run ruff format --check .
|
- poetry run ruff format --check .
|
||||||
|
|
||||||
lint-frontend:
|
lint-frontend:
|
||||||
desc: Lint frontend code
|
desc: Lint frontend code
|
||||||
@@ -199,8 +198,8 @@ tasks:
|
|||||||
fix:
|
fix:
|
||||||
desc: Format and fix linting issues (Python and frontend)
|
desc: Format and fix linting issues (Python and frontend)
|
||||||
cmds:
|
cmds:
|
||||||
- uv run ruff format ./
|
- poetry run ruff format ./
|
||||||
- uv run ruff check --fix ./
|
- poetry run ruff check --fix ./
|
||||||
- "{{.NPM}} run format"
|
- "{{.NPM}} run format"
|
||||||
- "{{.NPM}} run lint:fix"
|
- "{{.NPM}} run lint:fix"
|
||||||
|
|
||||||
@@ -239,6 +238,21 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- 'MESHCHAT_DEMO_IMAGE="reticulum-meshchatx-demo:local" {{.DOCKER_COMPOSE_CMD}} -f docker-compose.demo.yml up --remove-orphans'
|
- 'MESHCHAT_DEMO_IMAGE="reticulum-meshchatx-demo:local" {{.DOCKER_COMPOSE_CMD}} -f docker-compose.demo.yml up --remove-orphans'
|
||||||
|
|
||||||
|
docker-build-env:
|
||||||
|
desc: Build the Docker image for containerized builds
|
||||||
|
cmds:
|
||||||
|
- docker build -t {{.DOCKER_BUILD_IMAGE}} -f {{.DOCKER_BUILD_FILE}} .
|
||||||
|
|
||||||
|
docker-build-artifacts:
|
||||||
|
desc: Build whls and electron artifacts inside a container and export them
|
||||||
|
cmds:
|
||||||
|
- docker rm -f meshchat-build-temp || true
|
||||||
|
- docker run --name meshchat-build-temp {{.DOCKER_BUILD_IMAGE}}
|
||||||
|
- mkdir -p dist python-dist
|
||||||
|
- docker cp meshchat-build-temp:/app/dist/. ./dist/
|
||||||
|
- docker cp meshchat-build-temp:/app/python-dist/. ./python-dist/
|
||||||
|
- docker rm meshchat-build-temp
|
||||||
|
|
||||||
android-init:
|
android-init:
|
||||||
desc: Initialize Gradle wrapper for Android project
|
desc: Initialize Gradle wrapper for Android project
|
||||||
cmds:
|
cmds:
|
||||||
|
|||||||
Reference in New Issue
Block a user