-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathTaskfile.yaml
215 lines (182 loc) · 6.85 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
version: "3"
silent: true
env: {}
vars:
frameworks: "django golang java_springboot laravel nodejs rails"
languages: "ru en"
framework_template_dir: "_pages/guides/framework_id"
tasks:
# default:
# cmds:
# - task: xxx
format:
desc: 'Run all code formatters. Important vars: "paths".'
run: once
cmds:
- task: format:gci
- task: format:gofumpt
format:gci:
desc: 'Format code with gci. Important vars: "paths".'
cmds:
- gci write -s Standard -s Default {{.CLI_ARGS}} {{.paths | default "bin/"}}
format:gofumpt:
desc: 'Format code with gofumpt. Important vars: "paths".'
cmds:
- gofumpt -extra -w {{.CLI_ARGS}} {{.paths | default "bin/"}}
# TODO: specify target framework
gen:pages:
desc: "Generate pages for all existing frameworks using framework_id folder as the source data"
cmds:
- |
for framework in {{.frameworks}}
do
for lang in {{.languages}}
do
target_dir=pages_$lang/guides/$framework
echo "# Regenerate $framework pages ($lang)"
rm -rf $target_dir
cp -a {{.framework_template_dir}} $target_dir
find $target_dir -type f -exec sed -i -e "s|framework_id|$framework|g" {} \;
if [ "x$framework" = "xgolang" ]
then
echo 1>&2 "WARNING: Removing $target_dir/200_real_apps because no content available for $framework at the moment"
rm -rf $target_dir/200_real_apps*
fi
echo
done
done
- |
# FIXME: this page not available for other frameworks and languages yet
git checkout pages_ru/guides/rails/200_real_apps/60_cron.md
gen:demo:
desc: "Generate asciinema werf demos"
cmds:
- echo TODO
install:demo-tools-ubuntu:
desc: "Install tools needed to record werf demos"
cmds:
# NOTE: also we need werf itself
- sudo apt install pv asciinema
- wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
clean:
desc: "Delete temporary directories after build/serve"
cmds:
- |
for d in $(ls -1d ./_site* ./.jekyll-cache* ./.jekyll-metadata 2>/dev/null) ; do
echo "Remove dir $d ..."
rm -rf $d
done
echo "Remove configurator generated content"
for d in $(ls -1d ./_includes/*/configurator ./pages_*/configurator* ./_data/*/configurator* 2>/dev/null) ; do
echo " Remove dir $d ..."
rm -rf $d
done
local:gen:configurator:
desc: "Regenerate configurator pages and copy to site directories"
cmds:
- |
(
echo Regenerate configurator pages...
cd bin/configurator
go run *.go
)
cp -R bin/configurator/static/* .
cp -R bin/configurator/generated/* .
docker:network:create:
desc: 'Create shared docker network werfio-dev to use with werf/website'
vars:
NETWORK_NAME: werfio-dev
cmds:
- docker network create -d=bridge {{.NETWORK_NAME}}
status:
- docker network inspect {{.NETWORK_NAME}}
compose:up:
desc: 'Run jekyll in werf compose for local development. Use lang=en or lang=ru to run only specified lang. Run task compose:up in werf/werf repository to access documentation.'
deps:
- docker:network:create
cmds:
- |
services="{{ .lang }}"
services=${services:-"en ru"}
# Run compose up in docs directory.
which werf >/dev/null || source $(trdl use werf 2 beta)
werf compose up jekyll_base backend --dev --docker-compose-command-options="$services front backend" --platform=linux/amd64 || true
compose:down:
desc: 'Stop and clean after werf compose'
cmds:
- |
which werf >/dev/null || source $(trdl use werf 2 beta)
# Workaround: set image variable to stub image.
WERF_JEKYLL_BASE_DOCKER_IMAGE_NAME=nginx:latest \
WERF_BACKEND_DOCKER_IMAGE_NAME=nginx:latest \
werf compose down
site:check-broken-links:
desc: 'Check docs for broken links.'
deps:
- site:check-broken-links:ru
- site:check-broken-links:en
site:check-broken-links:ru:
desc: 'Check ru docs for broken links.'
cmds:
- |
./scripts/docs/check_broken_links.sh ru
site:check-broken-links:en:
desc: 'Check en docs for broken links.'
cmds:
- |
./scripts/docs/check_broken_links.sh en
site:run-spell-check:
desc: 'Run spell check for all pages.'
deps:
- site:run-spell-check:ru
- site:run-spell-check:en
site:run-spell-check:ru:
desc: 'Run spell check for ru pages. You can specify the path to a specific file with `-- ./path/to/file`'
cmds:
- |
./scripts/docs/spelling/spell_check.sh ru {{.CLI_ARGS}}
site:run-spell-check:en:
desc: 'Run spell check for en pages. You can specify the path to a specific file with `-- ./path/to/file`'
cmds:
- |
./scripts/docs/spelling/spell_check.sh en {{.CLI_ARGS}}
site:generate-special-dictionary:
desc: 'Generate a dictionary of special terms.'
cmds:
- |
test -f ./scripts/docs/spelling/dictionaries/dev_OPS.dic && rm ./scripts/docs/spelling/dictionaries/dev_OPS.dic
touch ./scripts/docs/spelling/dictionaries/dev_OPS.dic
cat ./scripts/docs/spelling/wordlist | wc -l | sed 's/^[ \t]*//g' >> ./scripts/docs/spelling/dictionaries/dev_OPS.dic
sort -u -f -o ./scripts/docs/spelling/wordlist{,}
sort -u -f ./scripts/docs/spelling/wordlist >> ./scripts/docs/spelling/dictionaries/dev_OPS.dic
site:get-words-with-typos:
desc: 'Pulls out a list of all the terms in all pages that were considered a typo'
deps:
- site:get-words-with-typos:ru
- site:get-words-with-typos:en
site:get-words-with-typos:ru:
desc: 'Pulls out a list of all the terms in RU pages that were considered a typo'
cmds:
- |
task site:run-spell-check:ru | sed '1,/Checking/ d' | sed '/^$/d' | sed '/Checking/d' | sort -u > spell_log_ru
site:get-words-with-typos:en:
desc: 'Pulls out a list of all the terms in EN pages that were considered a typo'
cmds:
- |
task site:run-spell-check:en | sed '1,/Checking/ d' | sed '/^$/d' | sed '/Checking/d' | sort -u > spell_log_en
site:view-plain-text-of-target-html:en:
desc: 'Displays EN HTML stripped of tags.'
cmds:
- |
./scripts/docs/spelling/spell_check.sh en {{.CLI_ARGS}} plain_text
site:view-plain-text-of-target-html:ru:
desc: 'Displays RU HTML stripped of tags.'
cmds:
- |
./scripts/docs/spelling/spell_check.sh ru {{.CLI_ARGS}} plain_text
site:view-plain-text-of-target-html:
desc: 'Displays both HTML stripped of tags.'
cmds:
- |
task site:view-plain-text-of-target-html:en -- {{.CLI_ARGS}}
task site:view-plain-text-of-target-html:ru -- {{.CLI_ARGS}}