-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (56 loc) · 2.72 KB
/
Copy pathMakefile
File metadata and controls
75 lines (56 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.PHONY: help setup setup-daemon setup-ui dev dev-all dev-daemon dev-ui clean build build-daemon build-ui lint test test-integration
DAEMON_DIR := daemon
UI_DIR := ui
VENV := $(DAEMON_DIR)/.venv
PYTHON := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
setup: setup-daemon setup-ui ## Set up both daemon and UI development environments
setup-daemon: ## Set up Python daemon venv and install dependencies
cd $(DAEMON_DIR) && python3 -m venv .venv
$(PIP) install -e ".[dev]"
setup-ui: ## Set up Tauri UI project dependencies
cd $(UI_DIR) && npm install
dev: ## Start daemon in demo mode (no credentials needed)
./dev.sh
dev-all: ## Start daemon + Tauri UI in demo mode
./dev.sh --with-ui
dev-daemon: ## Run daemon in development mode
$(PYTHON) -m cloud_drive_sync --log-level debug
dev-ui: ## Run Tauri UI in development mode
cd $(UI_DIR) && npm run tauri dev
clean: ## Clean build artifacts
rm -rf $(DAEMON_DIR)/.venv $(DAEMON_DIR)/dist $(DAEMON_DIR)/build
rm -rf $(UI_DIR)/node_modules $(UI_DIR)/src-tauri/target
rm -rf artifacts/
build: build-webui build-daemon build-ui ## Build everything (webui, daemon, UI)
build-webui: ## Build React web UI and copy into daemon http/webui package
cd $(UI_DIR) && WEB=1 npm run build
rm -rf $(DAEMON_DIR)/src/cloud_drive_sync/http/webui
cp -r $(UI_DIR)/dist $(DAEMON_DIR)/src/cloud_drive_sync/http/webui
build-daemon: ## Build daemon with Docker (PyInstaller)
docker build -f docker/Dockerfile.daemon -t cloud-drive-sync-daemon-builder .
mkdir -p artifacts
docker run --rm -v $(PWD)/artifacts:/out cloud-drive-sync-daemon-builder
build-ui: ## Build Tauri UI with Docker
docker build -f docker/Dockerfile.ui -t cloud-drive-sync-ui-builder .
mkdir -p artifacts
docker run --rm -v $(PWD)/artifacts:/out cloud-drive-sync-ui-builder
lint: ## Run linters
cd $(DAEMON_DIR) && $(VENV)/bin/ruff check src/ tests/
cd $(UI_DIR) && npx tsc --noEmit
test: ## Run all tests
cd $(DAEMON_DIR) && $(VENV)/bin/pytest -v
test-integration: ## Run integration tests (demo mode, no credentials)
cd $(DAEMON_DIR) && $(VENV)/bin/pytest -v -m integration tests/test_integration.py
install-service: ## Install systemd user service
mkdir -p ~/.config/systemd/user
cp installer/cloud-drive-sync-daemon.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable cloud-drive-sync-daemon
uninstall-service: ## Remove systemd user service
systemctl --user disable cloud-drive-sync-daemon || true
systemctl --user stop cloud-drive-sync-daemon || true
rm -f ~/.config/systemd/user/cloud-drive-sync-daemon.service
systemctl --user daemon-reload