-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
83 lines (69 loc) · 1.98 KB
/
Taskfile.yml
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
version: '3'
vars:
MKDOCS_WORKING_DIR: ical
MODEL_REPO: [email protected]:AKSW/leipzig.dataweek.de-model.git
MODEL_DIR: .model
SOURCE_GRAPH_FILE: graph
GRAPH_FILE: ical/data/graph
GRAPH_IRI: https://2023.dataweek.de/
tasks:
default:
desc: The default task shows an overview of all tasks
cmds:
- task -a
ci:
desc: The task to be run by the CI
cmds:
- task: install
- task: data:sync
- task: track:commit-and-push-data
- task: build
install:
desc: Install the dependencies
cmds:
- poetry install
serve:
desc: Serve the mkdocs resources
dir: '{{.MKDOCS_WORKING_DIR}}'
cmds:
- poetry run mkdocs serve
build:
desc: Build the mkdocs site
dir: '{{.MKDOCS_WORKING_DIR}}'
cmds:
- poetry run mkdocs build
data:sync:
desc: Synchronize the data in the CI
cmds:
- task: data:model-update
- task: data:get-graph
data:sync:local:
desc: Synchronize the data including local changes in a dev setup
deps:
- data:model-init
cmds:
- cd .model && task sync:local
- task: data:get-graph
data:get-graph:
cmds:
- cp {{.MODEL_DIR}}/{{.SOURCE_GRAPH_FILE}}.nt {{.GRAPH_FILE}}.nt
- cp {{.MODEL_DIR}}/{{.SOURCE_GRAPH_FILE}}.nt.graph {{.GRAPH_FILE}}.nt.graph
- echo {{.MODEL_REPO}} > {{.GRAPH_FILE}}.nt.source
- cd {{.MODEL_DIR}} && git rev-parse HEAD >> ../{{.GRAPH_FILE}}.nt.source
data:model-update:
deps:
- data:model-init
cmds:
- cd {{.MODEL_DIR}} && git pull
data:model-init:
cmds:
- git clone {{.MODEL_REPO}} {{.MODEL_DIR}}
status:
- test -d {{.MODEL_DIR}}
track:commit-and-push-data:
- git add {{.GRAPH_FILE}}.nt {{.GRAPH_FILE}}.nt.graph {{.GRAPH_FILE}}.nt.source
- task: track:commit-and-push
track:commit-and-push:
cmds:
- git -c user.name="{{.GIT_USER_NAME}}" -c user.email="{{.GIT_USER_EMAIL}}" commit -m "{{.GIT_COMMIT_MESSAGE}}" || echo ""
- git push || echo ""