This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Taskfile.yaml
265 lines (223 loc) · 5.29 KB
/
Taskfile.yaml
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# https://taskfile.dev
version: '3'
vars:
DEV_CMD: "scripts/eda_dev.sh"
MINIKUBE_CMD: "scripts/eda_kube.sh"
DOCKER_COMPOSE: "docker-compose"
DOCKER_COMPOSE_ARGS: "--project-name eda --file tools/docker/docker-compose.yml"
tasks:
default:
desc: "Show this message and exit"
cmds:
- task -l
silent: true
lint:
desc: "Run all linters."
cmds:
- task: lint:black
- task: lint:isort
- task: lint:flake8
test:
desc: "Run project tests."
cmds:
- python -m pytest
lint:black:
desc: "Check code with `black`."
cmds:
- black --check .
lint:isort:
desc: "Check code with `isort`."
cmds:
- isort --check .
lint:flake8:
desc: "Check code with `flake8`."
cmds:
- flake8
format:
desc: "Run all code formatters."
cmds:
- task: format:isort
- task: format:black
format:isort:
desc: "Format code with `isort`."
cmds:
- isort .
format:black:
desc: "Format code with `black`."
cmds:
- black .
dev:
desc: "Run eda_dev.sh with specified CLI arguments."
summary: |
Run eda_dev.sh with specified CLI arguments.
Example:
$ task dev -- services-start
cmds:
- '{{.DEV_CMD}} {{.CLI_ARGS}}'
dev:services:start:
desc: "Start EDA service containers"
cmds:
- task: dev
vars:
CLI_ARGS: services-start
dev:services:stop:
desc: "Stop EDA service containers"
cmds:
- task: dev
vars:
CLI_ARGS: services-stop
dev:services:clean:
desc: "Clean up EDA service image(s) & volume(s)"
cmds:
- task: dev
vars:
CLI_ARGS: services-clean
dev:run:migrations:
desc: "Run DB migrations"
cmds:
- task: dev
vars:
CLI_ARGS: db-migrations
dev:rbac:loaddata:
desc: "Load RBAC user and roles from tools/initial_data.yml file"
cmds:
- task: dev
vars:
CLI_ARGS: load-rbac-data
dev:api:start:
desc: "Start API server"
cmds:
- task: dev
vars:
CLI_ARGS: api-start
dev:api:stop:
desc: "Stop API server"
cmds:
- task: dev
vars:
CLI_ARGS: api-stop
dev:ui:start:
desc: "Start UI server"
cmds:
- task: dev
vars:
CLI_ARGS: ui-start
dev:ui:stop:
desc: "Stop UI server"
cmds:
- task: dev
vars:
CLI_ARGS: ui-stop
dev:all:start:
desc: "Start dev environment"
cmds:
- task: dev:services:start
- task: dev:run:migrations
- task: dev:api:start
- task: dev:ui:start
dev:all:stop:
desc: "Halt dev environment and cleanup services"
cmds:
- task: dev:ui:stop
- task: dev:api:stop
- task: dev:services:stop
docker:
desc: "Run docker-compose with specified CLI arguments."
summary: |
Run docker-compose with specified CLI arguments.
Example:
$ task docker -- ls
cmds:
- '{{.DOCKER_COMPOSE}} {{.DOCKER_COMPOSE_ARGS}} {{.CLI_ARGS}}'
docker:build:
desc: "Build container images."
cmds:
- task: docker
vars:
CLI_ARGS: build
docker:up:
desc: "Start all services."
cmds:
- task: docker
vars:
CLI_ARGS: up --detach
docker:up:postgres:
desc: "Start PostgreSQL service."
cmds:
- task: docker
vars:
CLI_ARGS: up --detach postgres
docker:down:
desc: "Stop all services."
cmds:
- task: docker
vars:
CLI_ARGS: down
docker:purge:
desc: "Stop all containers and delete all volumes."
cmds:
- task: docker
vars:
CLI_ARGS: down --volumes
docker:devuser:add:
desc: "Add development user"
cmds:
- task: dev
vars:
CLI_ARGS: add-dev-user
minikube:
desc: "Run eda_kube.sh with specified CLI arguments."
summary: |
Run eda.sh with specified CLI arguments.
Example:
$ task minikube -- build
cmds:
- '{{.MINIKUBE_CMD}} {{.CLI_ARGS}}'
minikube:build:
desc: "Build docker image and push to minikube"
cmds:
- task: minikube
vars:
CLI_ARGS: build {{.CLI_ARGS}}
minikube:deploy:
desc: "Build deployment and deploy to minikube"
cmds:
- task: minikube
vars:
CLI_ARGS: deploy {{.CLI_ARGS}}
minikube:clean:
desc: "Clean deployment directory and clean minikube resources"
cmds:
- task: minikube
vars:
CLI_ARGS: clean {{.CLI_ARGS}}
minikube:fp:ui:
desc: "Forward local port to ui instance port in minikube"
cmds:
- task: minikube
vars:
CLI_ARGS: port-forward-ui {{.CLI_ARGS}}
minikube:devuser:add:
desc: "Add development user"
cmds:
- task: minikube
vars:
CLI_ARGS: add-dev-user
minikube:rbac:loaddata:
desc: "Load RBAC user and roles from tools/initial_data.yml file"
cmds:
- task: minikube
vars:
CLI_ARGS: load-rbac-data
minikube:logs:
desc: "Get eda-server pod logs"
cmds:
- task: minikube
vars:
CLI_ARGS: eda-server-logs {{.CLI_ARGS}}
minikube:all:
desc: "clean, build, deploy"
cmds:
- task: minikube:clean
- task: minikube:build
- task: minikube:deploy