Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
179 lines (160 loc) · 5.83 KB
/
Copy pathTaskfile.yml
File metadata and controls
179 lines (160 loc) · 5.83 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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
# https://taskfile.dev
version: '3'
vars:
TESTING_DIR: './backend/Testing'
HG_REPO_DIR: './hgweb/repos'
includes:
k8s:
taskfile: ./deployment/Taskfile.yml
dir: ./deployment
gh:
dir: ./.github
taskfile: ./.github/Taskfile.yml
ui:
taskfile: ./frontend/Taskfile.yml
dir: ./frontend
fw-ui:
taskfile: ./frontend/viewer/Taskfile.yml
dir: ./frontend/viewer
api:
taskfile: ./backend/Taskfile.yml
dir: ./backend
hgweb:
taskfile: ./hgweb/Taskfile.yml
dir: ./hgweb
test:
taskfile: ./backend/Testing/Taskfile.yml
dir: ./backend/Testing
fw-lite:
taskfile: ./backend/FwLite/Taskfile.yml
dir: ./backend/FwLite
crowdin:
aliases: [c]
taskfile: ./crowdin/Taskfile.yml
dir: ./crowdin
tasks:
setup:
deps: [ setup-win, setup-unix ]
cmds:
- git config blame.ignoreRevsFile .git-blame-ignore-revs
- pnpm dlx husky
- task: setup-k8s
setup-k8s:
cmds:
- kubectl --context=docker-desktop apply -f deployment/setup/namespace.yaml
- kubectl --context=docker-desktop apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml
setup-win:
platforms: [ windows ]
cmds:
- powershell "if (!(test-path deployment/local-dev/local.env)) { cp deployment/local-dev/local.env.template deployment/local-dev/local.env }"
setup-unix:
platforms: [ linux, darwin ]
cmds:
- "test -f deployment/local-dev/local.env || cp deployment/local-dev/local.env.template deployment/local-dev/local.env"
setup-local-env:
cmds:
- echo "HONEYCOMB_API_KEY=__REPLACE__" > deployment/local-dev/local.env
- echo "#OTEL_SDK_DISABLED=true" >> deployment/local-dev/local.env
- echo "GOOGLE_OAUTH_CLIENT_ID=__REPLACE__.apps.googleusercontent.com" >> deployment/local-dev/local.env
- echo "GOOGLE_OAUTH_CLIENT_SECRET=__REPLACE__" >> deployment/local-dev/local.env
# k8s
up:
interactive: true
aliases: [backend-up]
cmds:
- tilt up
prod-ui-up:
interactive: true
desc: 'Starts the cluster using the production build of UI, good for automated testing'
cmds:
- tilt up -- --prod-ui-build
prod-up:
interactive: true
desc: 'Starts the cluster using the production build, should use less memory, good for testing'
cmds:
- tilt up -- --prod-build
# dev
infra-up:
desc: 'Starts infrastructure for our ui and api, does not forward ports for api, if you want port forwarding use k8s:infra-forward'
cmds:
- tilt up -- --lexbox-api-local
ui-dev:
aliases: [ ui ]
desc: The single command for local ui development
dir: ./frontend
deps: [ backend-up, ui:only ]
interactive: true
# api
api-dev:
aliases: [ api ]
desc: The single command for local api development
deps: [ infra-up, api:only, k8s:infra-forward ]
interactive: true
local-lexbox:
desc: 'Run front and backend locally'
deps: [api:only, k8s:infra-forward, ui:lexbox-only]
interactive: true
verify:
desc: 'Frontend pre-done gate: ui:verify (LexBox app) and fw-ui:verify (viewer) in parallel; backend drift is `task check-generated`.'
cmds:
# Both apps share one pnpm workspace: install once up front, so the parallel verifies never run two installs at once.
- task: ui:install
- task: fw-ui:install
- task: _verify-parallel
_verify-parallel:
internal: true
deps: [ ui:verify, fw-ui:verify ]
check-generated:
desc: 'Runs every committed-artifact drift check CI runs (EF model x2, gql schema, OpenAPI, FwLite TS types); reports all, fails if any fail.'
silent: true
# Runs each check even after one fails, so one pass lists every stale artifact.
# `dotnet ef` does not restore; in a fresh worktree it fails with NETSDK1004 without these.
cmd: |
dotnet restore backend/LexBoxApi/LexBoxApi.csproj --verbosity quiet
dotnet restore backend/FwLite/LcmCrdt/LcmCrdt.csproj --verbosity quiet
failed=""
for t in api:has-pending-model-changes api:check-gql-schema api:check-openapi-schema fw-lite:has-pending-model-changes fw-lite:has-stale-generated-types; do
echo "check-generated: $t"
"{{.TASK_EXE}}" "$t" || failed="$failed $t"
done
if [ -n "$failed" ]; then echo "check-generated FAILED:$failed"; exit 1; fi
echo "check-generated: all OK"
fw-lite-web:
aliases:
- web
- web-for-develop
deps: [ fw-lite:web, ui:fw-lite-infr]
fw-lite-win:
deps: [fw-lite:maui-windows, ui:fw-lite-infr]
fw-lite-mac:
aliases: [mac]
desc: Build & run FwLiteMaui on Mac Catalyst
deps: [fw-lite:maui-mac]
fw-lite-android:
aliases: [android]
deps: [fw-lite:run-maui-android]
fw-lite-android-dev:
aliases: [android-dev]
desc: Build & run the "Dev" flavor on Android (installs alongside the prod app)
deps: [fw-lite:run-maui-android-dev]
fw-lite-android-emulator-dev:
aliases: [android-emulator-dev]
desc: Build & run the "Dev" flavor on a running x86_64 emulator (installs alongside the prod app)
deps: [fw-lite:run-maui-android-emulator-dev]
fw-lite-android-install:
aliases: [android-install]
desc: Install without building
deps: [fw-lite:install-maui-android]
fw-lite-android-install-dev:
aliases: [android-install-dev]
desc: Install the "Dev" flavor without building
deps: [fw-lite:install-maui-android-dev]
fw-lite-android-install-emulator-dev:
aliases: [android-install-emulator-dev]
desc: Install the "Dev" flavor on a running x86_64 emulator without building
deps: [fw-lite:install-maui-android-emulator-dev]
fw-lite-android-release-dev:
aliases: [android-release-dev]
desc: Build a Release "Dev" APK and adb-install it on the connected USB device
deps: [fw-lite:install-maui-android-release-dev]