-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
148 lines (124 loc) · 3.67 KB
/
Copy pathTaskfile.yml
File metadata and controls
148 lines (124 loc) · 3.67 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
145
146
147
148
version: '3'
tasks:
install:
desc: Install dependencies using uv
cmds:
- uv sync
add-bean:
desc: Add a new coffee bean
cmds:
- uv run beanratio add-bean {{.CLI_ARGS}}
log:
desc: Log today's brew
cmds:
- uv run beanratio log {{.CLI_ARGS}}
recommend:
desc: Get recommended ratio and bean amount
cmds:
- uv run beanratio recommend {{.CLI_ARGS}}
list:
desc: List all beans
cmds:
- uv run beanratio list
show:
desc: Show detailed information for a bean
cmds:
- uv run beanratio show {{.CLI_ARGS}}
history:
desc: Show brew history for a bean
cmds:
- uv run beanratio history {{.CLI_ARGS}}
set-favorite:
desc: Set favorite recipe for a bean
cmds:
- uv run beanratio set-favorite {{.CLI_ARGS}}
delete-logs:
desc: Delete log(s) for a bean
cmds:
- uv run beanratio delete-logs {{.CLI_ARGS}}
clear-logs:
desc: Clear all logs (keep bean data)
cmds:
- uv run beanratio clear-logs
help:
desc: Show help
cmds:
- uv run beanratio --help
deploy:
desc: Deploy to AWS Lambda (full deployment with IAM/S3 setup)
cmds:
- bash deploy/deploy.sh
deploy-update:
desc: Update Lambda function code only (recommended for code changes)
cmds:
- bash deploy/update-code.sh
deploy-info:
desc: Show deployment information
cmds:
- cat deploy/deployment-info.txt
debug:
desc: Run local debug server (requires Docker and LocalStack)
cmds:
- bash local-debug-run.sh
debug-bg:
desc: Run local debug server in background
cmds:
- 'bash local-debug-run.sh > /tmp/beanratio-debug.log 2>&1 &'
- 'echo "Server starting in background. Logs: /tmp/beanratio-debug.log"'
debug-wait:
desc: Wait for debug server to be ready
cmds:
- |
echo "Waiting for server to be ready..."
for i in {1..30}; do
if curl -s http://localhost:3000/beans?token=test-token-12345 > /dev/null 2>&1; then
echo "Server is ready!"
exit 0
fi
sleep 1
echo -n "."
done
echo ""
echo "Timeout waiting for server"
exit 1
debug-test:
desc: Test the local debug server with sample request
cmds:
- 'curl -v "http://localhost:3000/beans?token=test-token-12345"'
debug-test-header:
desc: Test the local debug server using header authentication
cmds:
- 'curl -v -H "X-Auth-Token: test-token-12345" http://localhost:3000/beans'
debug-restart:
desc: Restart Python server only (keep LocalStack and data)
cmds:
- pkill -f local-test-server.py || true
- sleep 1
- 'bash local-debug-run.sh > /tmp/beanratio-debug.log 2>&1 &'
- 'echo "Server restarting in background. Logs: /tmp/beanratio-debug.log"'
- task: debug-wait
- 'echo "Server restarted successfully"'
debug-full:
desc: Start debug server and run test (keep data if LocalStack is running)
cmds:
- task: debug-restart
- task: debug-test
debug-full-clean:
desc: Clean all data and start fresh debug server
cmds:
- task: debug-clean
- task: debug-bg
- task: debug-wait
- task: debug-test
debug-stop:
desc: Stop and remove the local debug server (LocalStack container and Python server)
cmds:
- pkill -f local-test-server.py || true
- docker stop localstack || true
- docker rm localstack || true
- echo "LocalStack container and server processes stopped"
debug-clean:
desc: Clean up all debug resources (containers and temporary files)
cmds:
- task: debug-stop
- echo "Debug resources cleaned"