forked from eccenca/documentation.eccenca.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
172 lines (148 loc) · 4.83 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
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
---
# https://taskfile.dev
version: '3'
vars:
PUBLIC_BRANCH: published
CURRENT_VERSION: 22.2
MATERIAL_INSIDER_TAG: 8.5.8-insiders-4.26.2
MATERIAL_TAG: 8.5.8
tasks:
default:
summary: |
List documented tasks
silent: true
cmds:
- task --list
versions:
desc: List relevant versions for a mkdocs material bug report
silent: true
cmds:
- |
cat << EOF
- Python: {{.PYTHON_VERSION}}
- MkDocs: {{.MKDOCS_VERSION}}
- Material: {{.MATERIAL_VERSION}}
EOF
vars:
PYTHON_VERSION:
sh: poetry run python --version
MKDOCS_VERSION:
sh: poetry run mkdocs --version | cut -d " " -f -3
MATERIAL_VERSION:
sh: poetry run pip show mkdocs-material | grep Version | cut -d " " -f 2
clean:
desc: Clean up working directory
run: once
cmds:
- rm -rf site
install:
desc: Install needed dependencies
cmds:
- poetry install
check:
desc: Run complete test suite
deps:
- check:links
check:links:
desc: Check outgoing links
deps:
- install
cmds:
- poetry run linkcheckMarkdown -r docs 2>&1 | grep -v "ResourceWarning"
build:
desc: Build the page
deps:
- task: install
cmds:
- poetry run mkdocs build --strict
serve:
desc: Serve the page on localhost
deps:
- task: install
cmds:
- poetry run mkdocs serve
use:public:
desc: switch to public package (non insider)
cmds:
- poetry remove mkdocs-material || exit 0
- poetry add mkdocs-material=={{.MATERIAL_TAG}}
- poetry update
use:insider-ssh:
desc: switch to insider package from github:eccenca via ssh (default)
cmds:
- poetry remove mkdocs-material || exit 0
- poetry add git+ssh://[email protected]:eccenca/mkdocs-material-insiders.git#{{.MATERIAL_INSIDER_TAG}}
- poetry update
use:insider-https-token:
desc: switch to insider package from github:eccenca via ACCESS_TOKEN variable (build plan)
cmds:
- poetry remove mkdocs-material || exit 0
- poetry add git+https://[email protected]/eccenca/mkdocs-material-insiders.git#{{.MATERIAL_INSIDER_TAG}}
- poetry update
update:icons:
desc: update the used eccenca icons from carbon
cmds:
- poetry run dec-tool update-icons \
--version {{.GUI_VERSION}} \
-o {{.ICON_DIR}} \
vars:
GUI_VERSION: main
ICON_DIR: overrides/.icons/eccenca
update:cmemc:
desc: re-generates the cmemc command reference
cmds:
- rm -rf {{.REFERENCE_DIR}}/*
- CMEMC_MANUAL_DIR={{.REFERENCE_DIR}} cmemc -q config
vars:
REFERENCE_DIR: docs/automate/cmemc-command-line-interface/command-reference
update:shape-reference:
desc: re-generates the shape and datatype references
summary: >
This task uses a running Corporate Memory to upload a specification for
a custom markdown endpoint (see shapedocu.ttl in
tools/update-shape-reference) for exporting.
In order to use this task, a valid cmemc Corporate Memory connection needs
to be available in the environment.
This can be done by setting CMEMC_CONNECTION or by using the eval command.
- CMEMC_CONNECTION=mycmem task update:shape-reference
- eval $(cmemc -c mycmem config eval); task update:shape-reference
cmds:
- cmemc graph import --replace {{.SRC}}
- cp {{.SRC}}/nodeshapedocu-head.md {{.NODESHAPES_MD}}
- "{{.CURL}} {{.API}}/nodeshapedocu >>{{.NODESHAPES_MD}}"
- cp {{.SRC}}/propertyshapedocu-head.md {{.PROPERTYSHAPES_MD}}
- "{{.CURL}} {{.API}}/propertyshapedocu >>{{.PROPERTYSHAPES_MD}}"
- cp {{.SRC}}/datatypedocu-head.md {{.DATATYPES_MD}}
- "{{.CURL}} {{.API}}/datatypedocu >>{{.DATATYPES_MD}}"
vars:
DIR: docs/explore-and-author/graph-exploration/building-a-customized-user-interface
TOKEN:
sh: cmemc admin token
DP:
sh: cmemc config get DP_API_ENDPOINT
CURL: "curl --silent -H 'Authorization: Bearer {{.TOKEN}}'"
API: "{{.DP}}/api/custom"
NODESHAPES_MD: "{{.DIR}}/node-shapes/index.md"
PROPERTYSHAPES_MD: "{{.DIR}}/property-shapes/index.md"
DATATYPES_MD: "{{.DIR}}/datatype-reference/index.md"
SRC: tools/update-shape-reference
public:versions:
desc: List public documentation versions
deps:
- task: install
cmds:
- poetry run mike list -b {{.PUBLIC_BRANCH}}
public:deploy:
desc: Publish the workding directory as version {{.CURRENT_VERSION}}
deps:
- task: install
cmds:
- >
poetry run mike deploy -b {{.PUBLIC_BRANCH}}
--update-aliases {{.CURRENT_VERSION}} latest
public:serve:
desc: Start a webserver to manually validate the public branch
deps:
- task: install
cmds:
- poetry run mike serve -b {{.PUBLIC_BRANCH}}