-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
149 lines (120 loc) · 3.69 KB
/
Taskfile.yaml
File metadata and controls
149 lines (120 loc) · 3.69 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
149
version: '3'
vars:
DC: docker compose -f deployments/docker-compose.yaml
DC_DEV: docker compose -f deployments/docker-compose.yaml -f deployments/docker-compose.dev.yaml
DC_E2E: docker compose -f deployments/docker-compose.yaml -f deployments/docker-compose.dev.yaml -f deployments/docker-compose.e2e.yaml
IMAGE_NAME: codeforge
IMAGE_TAG: latest
tasks:
dev:
desc: Start dev environment with hot reload
cmds:
- "{{.DC_DEV}} up --build"
dev:detach:
desc: Start dev environment in background
cmds:
- "{{.DC_DEV}} up --build -d"
down:
desc: Stop all containers and remove volumes
cmds:
- "{{.DC_DEV}} down"
down:clean:
desc: Stop all containers and remove volumes + data
cmds:
- "{{.DC_DEV}} down -v"
build:
desc: Build production Docker image
cmds:
- docker build -f deployments/Dockerfile -t {{.IMAGE_NAME}}:{{.IMAGE_TAG}} .
test:
desc: Run unit tests inside Docker
cmds:
- "{{.DC_DEV}} run --rm --no-deps app go test -cover ./..."
test:integration:
desc: Run integration tests (with Redis)
cmds:
- "{{.DC_DEV}} run --rm -e CODEFORGE_TEST_URL=http://app:8080 -e CODEFORGE_TEST_TOKEN=dev-token app go test -tags integration -v -count=1 ./tests/integration/..."
test:all:
desc: Run unit + integration tests
cmds:
- task: test
- task: test:integration
lint:
desc: Run golangci-lint inside Docker
cmds:
- "{{.DC_DEV}} run --rm --no-deps app golangci-lint run ./..."
fmt:
desc: Run gofmt inside Docker
cmds:
- "{{.DC_DEV}} run --rm --no-deps app gofmt -w ."
logs:
desc: Tail docker-compose logs
cmds:
- "{{.DC_DEV}} logs -f"
logs:app:
desc: Tail only app logs
cmds:
- "{{.DC_DEV}} logs -f app"
redis:cli:
desc: Open redis-cli
cmds:
- "{{.DC_DEV}} exec redis redis-cli"
shell:
desc: Open shell in app container
cmds:
- "{{.DC_DEV}} exec app sh"
mod:tidy:
desc: Run go mod tidy inside Docker
cmds:
- "{{.DC_DEV}} run --rm --no-deps app go mod tidy"
dev:e2e:
desc: Start dev environment with mock CLI for E2E testing
deps: [build:mock-cli]
cmds:
- "{{.DC_E2E}} up --build"
dev:e2e:detach:
desc: Start E2E environment in background
deps: [build:mock-cli]
cmds:
- "{{.DC_E2E}} up --build -d"
test:e2e:
desc: Run E2E tests (requires dev:e2e running)
cmds:
- "{{.DC_E2E}} run --rm -e CODEFORGE_TEST_URL=http://app:8080 -e CODEFORGE_TEST_TOKEN=dev-token app go test -tags integration -v -count=1 -timeout 120s ./tests/e2e/..."
build:action:
desc: Build CI Action Docker image
cmds:
- docker build -f deployments/Dockerfile.action -t codeforge-action:{{.IMAGE_TAG}} .
build:mock-cli:
desc: Build mock Claude CLI for testing
cmds:
- "{{.DC_DEV}} run --rm --no-deps app go build -o bin/mock-claude ./tests/mockcli"
# --- UI tasks ---
ui:lint:
desc: Run ESLint on UI
cmds:
- "{{.DC_DEV}} run --rm --no-deps ui npx eslint ."
ui:format:
desc: Run Prettier format on UI
cmds:
- "{{.DC_DEV}} run --rm --no-deps ui npx prettier --write ."
ui:format:check:
desc: Check Prettier formatting on UI
cmds:
- "{{.DC_DEV}} run --rm --no-deps ui npx prettier --check ."
ui:typecheck:
desc: Run TypeScript type checking on UI
cmds:
- "{{.DC_DEV}} run --rm --no-deps ui npx tsc --noEmit"
ui:build:
desc: Build UI production assets
cmds:
- "{{.DC_DEV}} run --rm --no-deps ui npm run build"
ui:shell:
desc: Open shell in UI container
cmds:
- "{{.DC_DEV}} exec ui sh"
logs:ui:
desc: Tail only UI logs
cmds:
- "{{.DC_DEV}} logs -f ui"