Skip to content

Commit 8a05802

Browse files
committed
chore(sorter): add sorter image and tasks sort wordlist
Signed-off-by: Evgeniy Frolov <[email protected]>
1 parent 0029621 commit 8a05802

4 files changed

Lines changed: 67 additions & 29 deletions

File tree

Taskfile.yaml

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ tasks:
100100
cp -R bin/configurator/generated/* .
101101
102102
docker:network:create:
103-
desc: 'Create shared docker network werfio-dev to use with werf/website'
103+
desc: "Create shared docker network werfio-dev to use with werf/website"
104104
vars:
105105
NETWORK_NAME: werfio-dev
106106
cmds:
@@ -109,7 +109,7 @@ tasks:
109109
- docker network inspect {{.NETWORK_NAME}}
110110

111111
compose:up:
112-
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.'
112+
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."
113113
deps:
114114
- docker:network:create
115115
cmds:
@@ -122,7 +122,7 @@ tasks:
122122
werf compose up jekyll_base backend --dev --docker-compose-command-options="$services front backend" --platform=linux/amd64 || true
123123
124124
compose:down:
125-
desc: 'Stop and clean after werf compose'
125+
desc: "Stop and clean after werf compose"
126126
cmds:
127127
- |
128128
which werf >/dev/null || source $(trdl use werf 2 beta)
@@ -132,84 +132,113 @@ tasks:
132132
werf compose down
133133
134134
site:check-broken-links:
135-
desc: 'Check docs for broken links.'
135+
desc: "Check docs for broken links."
136136
deps:
137137
- site:check-broken-links:ru
138138
- site:check-broken-links:en
139139

140140
site:check-broken-links:ru:
141-
desc: 'Check ru docs for broken links.'
141+
desc: "Check ru docs for broken links."
142142
cmds:
143143
- |
144144
./scripts/docs/check_broken_links.sh ru
145145
146146
site:check-broken-links:en:
147-
desc: 'Check en docs for broken links.'
147+
desc: "Check en docs for broken links."
148148
cmds:
149149
- |
150150
./scripts/docs/check_broken_links.sh en
151151
152152
site:run-spell-check:
153-
desc: 'Run spell check for all pages.'
153+
desc: "Run spell check for all pages."
154154
deps:
155155
- site:run-spell-check:ru
156156
- site:run-spell-check:en
157157

158158
site:run-spell-check:ru:
159-
desc: 'Run spell check for ru pages. You can specify the path to a specific file with `-- ./path/to/file`'
159+
desc: "Run spell check for ru pages. You can specify the path to a specific file with `-- ./path/to/file`"
160160
cmds:
161161
- |
162162
./scripts/docs/spelling/spell_check.sh ru {{.CLI_ARGS}}
163163
164164
site:run-spell-check:en:
165-
desc: 'Run spell check for en pages. You can specify the path to a specific file with `-- ./path/to/file`'
165+
desc: "Run spell check for en pages. You can specify the path to a specific file with `-- ./path/to/file`"
166166
cmds:
167167
- |
168168
./scripts/docs/spelling/spell_check.sh en {{.CLI_ARGS}}
169169
170170
site:generate-special-dictionary:
171-
desc: 'Generate a dictionary of special terms.'
171+
desc: "Generate a dictionary of special terms."
172172
cmds:
173173
- |
174-
test -f ./scripts/docs/spelling/dictionaries/dev_OPS.dic && rm ./scripts/docs/spelling/dictionaries/dev_OPS.dic
175-
touch ./scripts/docs/spelling/dictionaries/dev_OPS.dic
176-
cat ./scripts/docs/spelling/wordlist | wc -l | sed 's/^[ \t]*//g' >> ./scripts/docs/spelling/dictionaries/dev_OPS.dic
177-
sort -u -f -o ./scripts/docs/spelling/wordlist{,}
178-
sort -u -f ./scripts/docs/spelling/wordlist >> ./scripts/docs/spelling/dictionaries/dev_OPS.dic
174+
docker run --rm -v $(pwd)/scripts/:/scripts registry-write.werf.io/website/sorter:latest bash -c '
175+
test -f ./scripts/docs/spelling/dictionaries/dev_OPS.dic && rm ./scripts/docs/spelling/dictionaries/dev_OPS.dic
176+
touch ./scripts/docs/spelling/dictionaries/dev_OPS.dic
177+
cat ./scripts/docs/spelling/wordlist | wc -l | sed "s/^[ \t]*//g" >> ./scripts/docs/spelling/dictionaries/dev_OPS.dic
178+
sort -u -f -o ./scripts/docs/spelling/wordlist{,}
179+
sort -u -f ./scripts/docs/spelling/wordlist >> ./scripts/docs/spelling/dictionaries/dev_OPS.dic
180+
'
179181
180182
site:get-words-with-typos:
181-
desc: 'Pulls out a list of all the terms in all pages that were considered a typo'
183+
desc: "Pulls out a list of all the terms in all pages that were considered a typo"
182184
deps:
183185
- site:get-words-with-typos:ru
184186
- site:get-words-with-typos:en
185187

186188
site:get-words-with-typos:ru:
187-
desc: 'Pulls out a list of all the terms in RU pages that were considered a typo'
189+
desc: "Pulls out a list of all the terms in RU pages that were considered a typo"
188190
cmds:
189191
- |
190192
task site:run-spell-check:ru | sed '1,/Checking/ d' | sed '/^$/d' | sed '/Checking/d' | sort -u > spell_log_ru
191193
192194
site:get-words-with-typos:en:
193-
desc: 'Pulls out a list of all the terms in EN pages that were considered a typo'
195+
desc: "Pulls out a list of all the terms in EN pages that were considered a typo"
194196
cmds:
195197
- |
196198
task site:run-spell-check:en | sed '1,/Checking/ d' | sed '/^$/d' | sed '/Checking/d' | sort -u > spell_log_en
197199
198200
site:view-plain-text-of-target-html:en:
199-
desc: 'Displays EN HTML stripped of tags.'
201+
desc: "Displays EN HTML stripped of tags."
200202
cmds:
201203
- |
202204
./scripts/docs/spelling/spell_check.sh en {{.CLI_ARGS}} plain_text
203205
204206
site:view-plain-text-of-target-html:ru:
205-
desc: 'Displays RU HTML stripped of tags.'
207+
desc: "Displays RU HTML stripped of tags."
206208
cmds:
207209
- |
208210
./scripts/docs/spelling/spell_check.sh ru {{.CLI_ARGS}} plain_text
209211
210212
site:view-plain-text-of-target-html:
211-
desc: 'Displays both HTML stripped of tags.'
213+
desc: "Displays both HTML stripped of tags."
212214
cmds:
213215
- |
214216
task site:view-plain-text-of-target-html:en -- {{.CLI_ARGS}}
215217
task site:view-plain-text-of-target-html:ru -- {{.CLI_ARGS}}
218+
219+
_image:build:
220+
cmds:
221+
- docker build {{.CLI_ARGS}} --platform=linux/amd64,linux/arm64 -f "{{.dfilePath}}" -t "{{.imageName}}" "{{.context | default "."}}"
222+
223+
image:build:sorter:
224+
desc: 'Build wordlist sorter image. Important vars: "imageName".'
225+
cmds:
226+
- task: _image:build
227+
vars:
228+
dfilePath: scripts/docs/spelling/sorter/Dockerfile
229+
imageName:
230+
sh: "echo registry-write.werf.io/website/sorter:latest"
231+
232+
_image:push:
233+
cmds:
234+
- docker push {{.CLI_ARGS}} "{{.imageName}}"
235+
236+
image:publish:sorter:
237+
desc: 'Build and publish wordlist sorter image. Important vars: "imageName".'
238+
deps:
239+
- image:build:sorter
240+
cmds:
241+
- task: _image:push
242+
vars:
243+
imageName:
244+
sh: "echo registry-write.werf.io/website/sorter:latest"

scripts/docs/spelling/dictionaries/dev_OPS.dic

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ apiserver
1010
apiVersion
1111
app
1212
apparmor
13-
apps
1413
app’s
14+
apps
1515
Assumenda
1616
async
1717
au
@@ -46,8 +46,8 @@ commands
4646
conf
4747
config
4848
ConfigMap
49-
ConfigMaps
5049
ConfigMap’s
50+
ConfigMaps
5151
configs
5252
configurator
5353
configVersion
@@ -72,8 +72,8 @@ DevOps
7272
DevOpsConf
7373
Django
7474
Dockerfile
75-
Dockerfiles
7675
Dockerfile’s
76+
Dockerfiles
7777
dockerignore
7878
dockersamples
7979
DSL
@@ -410,8 +410,8 @@ YouTube
410410
пересборкой
411411
пересборку
412412
пересборок
413-
пересоберётся
414413
пересоберется
414+
пересоберётся
415415
пересобирает
416416
пересоздает
417417
пересоздастся
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt update && apt install -y locales && rm -rf /var/lib/apt/lists/*
4+
RUN locale-gen en_US.UTF-8
5+
6+
ENV LANG=en_US.UTF-8 \
7+
LANGUAGE=en_US:en \
8+
LC_ALL=en_US.UTF-8 \
9+
LC_COLLATE=en_US.UTF-8

scripts/docs/spelling/wordlist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ apiserver
99
apiVersion
1010
app
1111
apparmor
12-
apps
1312
app’s
13+
apps
1414
Assumenda
1515
async
1616
au
@@ -45,8 +45,8 @@ commands
4545
conf
4646
config
4747
ConfigMap
48-
ConfigMaps
4948
ConfigMap’s
49+
ConfigMaps
5050
configs
5151
configurator
5252
configVersion
@@ -71,8 +71,8 @@ DevOps
7171
DevOpsConf
7272
Django
7373
Dockerfile
74-
Dockerfiles
7574
Dockerfile’s
75+
Dockerfiles
7676
dockerignore
7777
dockersamples
7878
DSL
@@ -409,8 +409,8 @@ YouTube
409409
пересборкой
410410
пересборку
411411
пересборок
412-
пересоберётся
413412
пересоберется
413+
пересоберётся
414414
пересобирает
415415
пересоздает
416416
пересоздастся

0 commit comments

Comments
 (0)