-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
144 lines (119 loc) · 4.33 KB
/
Copy pathTaskfile.yaml
File metadata and controls
144 lines (119 loc) · 4.33 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
version: "3"
includes:
jq: ./Taskfiles/jq.yml
tasks:
default:
desc: List available tasks
cmds:
- task -l
all:
desc: Run all tasks
cmds:
- task install-dev
- task test
- task type-check
- task lint
- task markdownlint
test:
desc: Run tests with pytest
cmds:
- uv run pytest --cov=custom_components tests --cov-report=xml
mutation:
desc: Run advisory mutation testing
cmds:
- task: mutation:code
- task: mutation:mappings
mutation:code:
desc: Run mutmut against executable RoboVac code
cmds:
- uv run mutmut run {{.CLI_ARGS}}
mutation:browse:
desc: Browse mutmut survivors
cmds:
- uv run mutmut browse
mutation:mappings:
desc: Run RoboVac model mapping mutation audit
cmds:
- uv run python scripts/mutate_model_mappings.py {{.CLI_ARGS}}
install-dev:
desc: Install development dependencies
cmds:
- uv venv --allow-existing
- uv pip install -r requirements-dev.txt
install:
desc: Install dependencies
cmds:
- uv venv --allow-existing
- uv pip install -r requirements.txt
type-check:
desc: Type check with mypy
cmds:
- uv run mypy --config-file=pyproject.toml custom_components
lint:
desc: Lint with flake8
cmds:
- uv run flake8 custom_components tests
cache-eufy-pdfs:
desc: Refresh ignored local cache of eufy support owner-manual PDFs
cmds:
- uv run python scripts/cache_eufy_support_pdfs.py
analyze-eufy-pdfs:
desc: Analyze ignored eufy support PDF cache for names, modes, and features
cmds:
- uv run --with pypdf python scripts/analyze_eufy_support_pdfs.py --output .cache/eufy-support-pdfs/analysis.json
markdownlint:
desc: Lint with markdownlint
cmds:
- markdownlint-cli2 "**/*.md" "!vendor" "!.venv" --fix
ha-start:
desc: Start Home assistant, run from dev container
cmds:
- supervisor_run
ha-restart:
desc: Restart Home assistant, run from dev container
cmds:
- ha core restart
ha-deploy:
desc: Deploy robovac to Home Assistant on Kubernetes
cmds:
- tar --exclude='__pycache__' --exclude='*.pyc' -cvf /tmp/robovac.tar -C custom_components/robovac .
- kubectl cp /tmp/robovac.tar home-automation/home-assistant-0:/tmp/robovac.tar
- kubectl exec -n home-automation home-assistant-0 -- sh -c "rm -rf /config/custom_components/robovac/* && tar -xvf /tmp/robovac.tar -C /config/custom_components/robovac/ && find /config/custom_components/robovac -name '._*' -delete"
- rm /tmp/robovac.tar
ha-restart-k8s:
desc: Restart Home Assistant on Kubernetes
cmds:
- kubectl rollout restart statefulset/home-assistant -n home-automation
- kubectl rollout status statefulset/home-assistant -n home-automation --timeout=120s
ha-logs:
desc: View Home Assistant logs for robovac
cmds:
- kubectl exec -n home-automation home-assistant-0 -- sh -c "grep -i robovac /config/home-assistant.log | tail -50 || echo 'No robovac logs found'"
ha-logs-errors:
desc: View Home Assistant error logs
cmds:
- kubectl exec -n home-automation home-assistant-0 -- sh -c "grep -i error /config/home-assistant.log | tail -30"
ha-logs-tail:
desc: Tail Home Assistant logs live (Ctrl+C to stop)
cmds:
- kubectl exec -n home-automation home-assistant-0 -- tail -f /config/home-assistant.log
ha-shell:
desc: Open shell in Home Assistant pod
cmds:
- kubectl exec -it -n home-automation home-assistant-0 -- sh
ha-quick-deploy:
desc: Quick deploy without restart (for Python file changes only, quiet output)
cmds:
- tar --exclude='__pycache__' --exclude='*.pyc' -cf /tmp/robovac.tar -C custom_components/robovac .
- kubectl cp /tmp/robovac.tar home-automation/home-assistant-0:/tmp/robovac.tar
- kubectl exec -n home-automation home-assistant-0 -- sh -c "rm -rf /config/custom_components/robovac/* && tar -xf /tmp/robovac.tar -C /config/custom_components/robovac/ && find /config/custom_components/robovac -name '._*' -delete"
- rm /tmp/robovac.tar
- echo "Deployed! Run 'task ha-restart-k8s' to apply changes"
ha-deploy-restart:
desc: Deploy and restart Home Assistant (full cycle)
cmds:
- task: ha-deploy
- task: ha-restart-k8s
- sleep 5
- task: ha-logs