forked from reload/display-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
395 lines (347 loc) · 14.9 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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# https://taskfile.dev
version: "3"
vars:
PLANTUML_RENDERER_VERSION: 1.2022.2
DRAWIO_EXPORT_VERSION: 4.3.0
tasks:
default:
cmds:
- task --list-all
silent: true
git:clone:all:
desc: Git clone all projects if they have not yet been cloned.
dir: projects
silent: true
cmds:
# Unmodified repo os2display repos
# We do also have forks of some of these in github.com/kkos2display but
# they are not currently in use with the exception of display-templates.
- test -d display-api-service || git clone [email protected]:os2display/display-api-service.git
- test -d display-admin-client || git clone [email protected]:os2display/display-admin-client.git
- test -d display-client || git clone [email protected]:os2display/display-client.git
# Fork to include additional templates with the goal of eventual upstreaming.
- test -d display-templates || git clone [email protected]:kkos2/display-templates
# KK Specific repository for automated integration.
- test -d display-kk-integration || git clone [email protected]:kkos2/kk-display-integration.git
git:reset:all:
desc: Reset projects to upstream develop. This will DESTROY any local changes.
dir: projects
deps:
- git:clone:all
cmds:
- cd display-api-service
&& git reset --hard
&& git checkout develop
&& git pull
- cd display-templates
&& git reset --hard
&& git checkout kk-develop
&& git pull
- cd display-admin-client
&& git reset --hard
&& git checkout develop
&& git pull
- cd display-client
&& git reset --hard
&& git checkout develop
&& git pull
- cd display-kk-integration
&& git reset --hard
&& git checkout main
&& git pull
git:status:all:
desc: "Do a git status on all projects"
dir: projects
deps:
- git:clone:all
cmds:
- cd display-api-service && git status
- cd display-admin-client && git status
- cd display-client && git status
- cd display-templates && git status
- cd display-kk-integration && git status
integration:start:dev:
desc: Start a local instances of the integration poc server
summary: Be aware we do not run the server in a container
dir: projects/display-kk-integration
cmds:
- yarn install
- yarn start:dev
integration:generate-client:
desc: Generate a fresh api client based on the OpenAPI-spec shipped with api-service
cmds:
- projects/display-kk-integration/scripts/generate-client.sh ${PWD}/projects
display:reset:
desc: "Reset the display client project"
dir: projects/display-client
cmds:
- time ../../scripts/display-reset.sh
display:down:
desc: "Bring the display client project down and delete volumes"
dir: projects/display-client
cmds:
- docker compose down -v
display:stop:
desc: "Stop the display client project so that it can be started again"
dir: projects/display-client
cmds:
- docker compose stop
display:up:
desc: "Bring the display client project up"
dir: projects/display-client
cmds:
- docker compose up -d
admin:reset:
desc: "Reset the admin project by deleting all state and bringing the project up in a clean state."
dir: projects/display-admin-client
cmds:
- time ../../scripts/admin-reset.sh
admin:down:
desc: "Bring the display admin project down and delete volumes"
dir: projects/display-admin-client
cmds:
- docker compose down -v
admin:stop:
desc: "Stop the Display admin project so that it can be started again"
dir: projects/display-admin-client
cmds:
- docker compose stop
admin:up:
desc: "Bring the display client project up"
dir: projects/display-admin-client
cmds:
- docker compose up -d
admin:logs:
desc: "Show and tail logs"
dir: projects/display-admin-client
cmds:
- docker compose logs -f
templates:reset:
desc: "Reset the templates project by deleting all state and bringing the project up in a clean state."
dir: projects/display-templates
cmds:
- time ../../scripts/templates-reset.sh
templates:down:
desc: "Bring the display te,åæate project down and delete volumes"
dir: projects/display-templates
cmds:
- docker compose down -v
templates:stop:
desc: "Stop the Display templates project so that it can be started again"
dir: projects/display-templates
cmds:
- docker compose stop
templates:up:
desc: "Bring the Display templates project up"
dir: projects/display-templates
cmds:
- docker compose up -d
templates:logs:
desc: "Show and tail logs"
dir: projects/display-templates
cmds:
- docker compose logs -f
api:reset:
desc: "Reset the api project by deleting all state and bringing the project up in a clean state."
deps:
- network:setup
dir: projects/display-api-service
cmds:
- time ../../scripts/api-reset.sh
- task: api:template-load
api:spec-validate:
desc: Validate the openapi-spec shipped with display-client
dir: projects/display-api-service/public
cmds:
- docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli
validate
--input-spec /local/api-spec-v1.json
api:update-spec:
desc: "Update the openapi-spec for the API-server"
dir: projects/display-api-service
cmds:
- docker compose exec phpfpm composer update-api-spec
api:logs:
desc: "Show and tail logs"
dir: projects/display-api-service
cmds:
- docker compose logs -f
api:template-load:
desc: "Load a standard set of screen and slide templates into a running os2display"
dir: projects/display-api-service
cmds:
# The screen-layouts seems to have disappeared with https://github.com/os2display/display-templates/pull/76
# Until we know where to pull the layouts from we fall back to a commit prior to the change.
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/full-screen.json
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/six-areas.json
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/three-boxes-horizontal.json
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/three-boxes.json
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/touch-template.json
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/two-boxes-vertical.json
- docker compose exec phpfpm bin/console app:screen-layouts:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/src/screen-layouts/two-boxes.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/book-byen-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/book-review-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/calendar-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/contacts-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/event-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/event-list-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/event-theme-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/iframe-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/image-text-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/instagram-feed-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/kk-slideshow-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/poster-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/rss-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/service-message-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/slideshow-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/table-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/travel-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/twenty-three-video-config-develop.json
- docker compose exec phpfpm bin/console app:template:load https://raw.githubusercontent.com/kkos2/display-templates/kk-develop/build/video-config-develop.json
api:down:
desc: "Bring the display api project down and delete volumes"
dir: projects/display-api-service
cmds:
- docker compose down -v
api:up:
desc: "Bring the API project up"
dir: projects/display-api-service
cmds:
- docker compose up -d
api:stop:
desc: "Stop the Display api project so that it can be started again"
dir: projects/display-api-service
cmds:
- docker compose stop
traefik:reset:
desc: "Reset the traefik by taking the service down and bringing it back up again."
deps:
- network:setup
cmds:
- task: traefik:mkcert
- time scripts/traefik-reset.sh
traefik:logs:
desc: "Show and tail logs"
dir: traefik
cmds:
- docker compose logs -f
traefik:down:
desc: "Bring Traefik"
dir: traefik
cmds:
- docker compose down
traefik:mkcert:
desc: "Configure and install root certificates traefik can use to sign site certificates"
dir: traefik/certs
cmds:
- mkcert -cert-file local-cert.pem -key-file local-key.pem "*.local.itkdev.dk" "*.docker"
- mkcert -install
network:setup:
desc: "Ensure all external docker networks has been created"
cmds:
- docker network create frontend 2>/dev/null|| true
reset:
desc: "Reset all projects."
deps:
- network:setup
- git:clone:all
cmds:
- task: api:down
- task: admin:down
- task: display:down
- task: templates:down
- task: templates:reset
- task: api:reset
- task: admin:reset
- task: display:reset
- echo "Reset completed, sites can be accessed on the following urls"
- task: print:urls
stop:
desc: "Stop all projects."
deps:
- network:setup
- git:clone:all
cmds:
- task: templates:stop
- task: api:stop
- task: admin:stop
- task: display:stop
up:
desc: "Bring all projects up."
deps:
- network:setup
- git:clone:all
cmds:
- task: templates:up
- task: api:up
- task: admin:up
- task: display:up
- echo "Up completed, sites can be accessed on the following urls"
- task: print:urls
print:urls:
desc: "Print urls for the services a developer may want to access."
silent: true
cmds:
- echo "Display"
- echo " - Client - https://display-client.local.itkdev.dk"
- echo " - Admin - https://display-admin-client.local.itkdev.dk/admin"
- echo " - Templates demo - https://display-templates.local.itkdev.dk"
- echo " - Templates Storybook - https://storybook.local.itkdev.dk"
down:
desc: "Take all projects down."
cmds:
- task: traefik:down
- task: api:down
- task: admin:down
- task: display:down
diagrams:render:
desc: Render all diagrams
cmds:
- task: diagrams:plantuml:render
- task: diagrams:drawio:render
diagrams:build:plantuml:
desc: Build the container image we use for rendering plantuml
dir: tools/plantuml
cmds:
# We do not publish the image as it is very then wrapper around a download
# of platuml an as such having a published image would just be an extra
# thing to keep track of.
- IMAGE_URL=plantuml TAG=0.0.0 PLANTUML_VERSION={{.PLANTUML_RENDERER_VERSION}} task build
diagrams:plantuml:render:
desc: Render svg and png versions plantuml diagrams
deps: [_diagrams:mkdir, diagrams:build:plantuml]
dir: documentation
cmds:
# PDF is currently not supported: https://plantuml.com/pdf
- |
docker run \
-v "${PWD}/diagrams/:/checkout" \
-w "/checkout" \
plantuml:0.0.0 \
-verbose -tpng -o render-png *.puml
- |
docker run \
-v "${PWD}/diagrams/:/checkout" \
-w "/checkout" \
plantuml:0.0.0 \
-verbose -tsvg -o render-svg *.puml
diagrams:drawio:render:
desc: Render svg and png versions drawio diagrams
deps: [_diagrams:mkdir]
dir: documentation
cmds:
- |
docker run \
-v "${PWD}/diagrams:/data" rlespinasse/drawio-export:{{.DRAWIO_EXPORT_VERSION}} --remove-page-suffix --format png --output render-png --scale 2
- |
docker run \
-v "${PWD}/diagrams:/data" rlespinasse/drawio-export:{{.DRAWIO_EXPORT_VERSION}} --remove-page-suffix --format svg --output render-svg --scale 2
_diagrams:mkdir:
cmds:
- mkdir -p diagrams/render-png
- mkdir -p diagrams/render-svg
diagrams:clean:
desc: Delete all rendered diagrams
cmds:
- rm -fr diagrams/render-png
- rm -fr diagrams/render-svg