Files
officeconvert/Makefile
T
2026-03-26 17:08:53 -07:00

40 lines
1.3 KiB
Makefile

SHELL := /bin/sh
BUF ?= buf
.PHONY: buf-lint buf-generate py-sync go-test compose-up compose-up-dev run-server
buf-lint:
$(BUF) lint
buf-generate:
$(BUF) generate
py-sync:
uv sync --project python
go-test:
cd clients/go && go test ./...
compose-up:
docker compose --env-file .env.example -f deploy/docker-compose.yml up --build
compose-up-dev:
docker compose --env-file .env.example -f deploy/docker-compose.dev.yml up
run-server:
@set -a; \
if [ -f .env ]; then . ./.env; fi; \
set +a; \
export PYTHONPATH="$${PYTHONPATH:-gen/python:python/packages/officeconvert/src:python/packages/server/src}"; \
if [ "$${S3_ENDPOINT:-}" = "seaweedfs:8333" ]; then S3_ENDPOINT=localhost:8333; fi; \
if [ "$${S3_PUBLIC_ENDPOINT:-}" = "seaweedfs:8333" ]; then S3_PUBLIC_ENDPOINT=localhost:8333; fi; \
export S3_ENDPOINT="$${S3_ENDPOINT:-localhost:8333}"; \
export S3_PUBLIC_ENDPOINT="$${S3_PUBLIC_ENDPOINT:-localhost:8333}"; \
export S3_USE_SSL="$${S3_USE_SSL:-false}"; \
export S3_ACCESS_KEY="$${S3_ACCESS_KEY:-minioadmin}"; \
export S3_SECRET_KEY="$${S3_SECRET_KEY:-minioadmin}"; \
export S3_SESSION_TTL_SECONDS="$${S3_SESSION_TTL_SECONDS:-3600}"; \
export CONVERSION_CLEANUP_DELAY_SECONDS="$${CONVERSION_CLEANUP_DELAY_SECONDS:-3600}"; \
uv run --project python uvicorn officeconvert_server.app:app --host "$${UVICORN_HOST:-0.0.0.0}" --port "$${UVICORN_PORT:-8080}"