-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
206 lines (179 loc) · 4.41 KB
/
taskfile.yml
File metadata and controls
206 lines (179 loc) · 4.41 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# https://taskfile.dev
version: "3"
set: [errexit, nounset, pipefail]
shopt: [globstar]
env:
PROJECT_VERSION:
sh: uvx hatch version
TAG_VERSION:
sh: echo {{ .PROJECT_VERSION }} | tr '+' '.'
TAG_BRANCH:
sh: git branch --show-current
tasks:
default:
# If no task is specified, we use the magic variable `TASK_EXE` to call `task` again with `--list`.
# See https://github.com/go-task/task/issues/1562.
silent: true
cmds:
- "{{.TASK_EXE}} --list"
install-api-deps:
hidden: true
sources:
- ./pyproject.toml
- ./uv.lock
cmd: uv sync --no-install-project
install-web-deps:
hidden: true
sources:
- ./package.json
- ./pnpm-lock.yaml
cmd: pnpm install
gen-web-types:
hidden: true
deps: [install-web-deps]
sources:
- ./app/**/*
- ./public/**/*
- ./*
cmd: pnpm run typegen
check-api-lint:
hidden: true
deps: [install-api-deps]
sources:
- ./pyproject.toml
- ./api/**/*
- ./migrations/**/*
- exclude: ./api/instance/**/*
- exclude: ./**/__pycache__/**/*
cmd: uv run ruff check --fix
check-api-types:
hidden: true
deps: [install-api-deps]
sources:
- ./pyproject.toml
- ./api/**/*
- ./migrations/**/*
- exclude: ./api/instance/**/*
- exclude: ./**/__pycache__/**/*
cmd: uv run pyright
check-api-format:
hidden: true
deps: [install-api-deps]
sources:
- ./pyproject.toml
- ./api/**/*
- ./migrations/**/*
- exclude: ./api/instance/**/*
- exclude: ./**/__pycache__/**/*
cmd: uv run ruff format
check-web-lint:
hidden: true
deps: [gen-web-types]
sources:
- ./app/**/*
- ./public/**/*
- ./*
cmd: pnpm run lint
check-web-types:
hidden: true
deps: [gen-web-types]
sources:
- ./app/**/*
- ./public/**/*
- ./*
cmd: pnpm run typecheck
check-non-python-format:
hidden: true
deps: [install-web-deps]
sources:
- ./app/**/*
- ./public/**/*
- ./*
cmd: pnpm run format
check:
desc: Run all checks, applying formatting and linting fixes automatically
cmds:
- task: check-api-lint
- task: check-api-types
- task: check-api-format
- task: check-web-lint
- task: check-web-types
- task: check-non-python-format
build-docker-api:
hidden: true
interactive: true
cmd: >
docker build
--progress=quiet
--file server.Dockerfile
--tag archedbrows-server:{{ .TAG_VERSION }}
--tag archedbrows-server:{{ .TAG_BRANCH }}
--build-arg PROJECT_VERSION={{ .PROJECT_VERSION }}
.
&& echo archedbrows-server:{{ .TAG_VERSION }}
&& echo archedbrows-server:{{ .TAG_BRANCH }}
build-docker-web:
hidden: true
interactive: true
cmd: >
docker build
--progress=quiet
--file web.Dockerfile
--tag archedbrows-web:{{ .TAG_VERSION }}
--tag archedbrows-web:{{ .TAG_BRANCH }}
--build-arg PROJECT_VERSION={{ .PROJECT_VERSION }}
.
&& echo archedbrows-web:{{ .TAG_VERSION }}
&& echo archedbrows-web:{{ .TAG_BRANCH }}
build-docker:
desc: Build Docker container image
deps: [build-docker-api, build-docker-web]
build-web:
desc: Build web assets
deps: [install-web-deps]
sources:
- ./app/**/*
- ./public/**/*
- ./*
cmd: pnpm run build
dev-api:
hidden: true
deps: [install-api-deps]
cmd: uv run flask run --no-debugger
dev-web:
hidden: true
deps: [install-web-deps]
cmd: pnpm dev
dev:
desc: Run a development server
deps: [dev-api, dev-web]
serve-api:
hidden: true
deps: [install-api-deps]
cmd: uv run waitress-serve --port 8001 --call archedbrows:create_app
serve-web:
hidden: true
deps: [build-web]
cmd: PORT=8000 pnpm start
serve-proxy:
hidden: true
cmd: caddy run
serve:
desc: Run a preview of a production server
deps: [serve-api, serve-web, serve-proxy]
run-migrations:
desc: Run database ./migrations/**/*
deps: [install-api-deps]
cmd: uv run flask --app archedbrows db upgrade
clean:
desc: Clean all ephemeral and build files (excluding database sqlite file)
cmd: >
rm -rf
./.react-router/
./.ruff_cache/
./.task/
./.venv/
./build/
./node_modules/
./**/__pycache__/
./**/_version.py