-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation - scripts, the final part #154
base: master
Are you sure you want to change the base?
Changes from all commits
757e8b9
0409819
b3e8842
0b496ff
d6737e4
28dcb43
b49ec53
e232600
a870157
d576bb8
9a489d6
1224747
6a2d844
dbff3b4
4da83d1
8486764
94c246a
81147a6
67520a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,46 @@ include: | |
- project: 'QubesOS/qubes-continuous-integration' | ||
file: '/gitlab-website.yml' | ||
|
||
stages: | ||
- prepare | ||
- build | ||
|
||
build:website: | ||
extends: .website | ||
|
||
update-transifex: | ||
tags: | ||
- docker | ||
stage: prepare | ||
rules: | ||
- if: '$TX_TOKEN && $GITHUB_KEY' | ||
when: always | ||
- when: never | ||
artifacts: | ||
expire_in: 7 days | ||
when: always | ||
paths: | ||
- site.tar.gz | ||
variables: | ||
GIT_SUBMODULE_STRATEGY: normal | ||
GIT_AUTHOR_NAME: translation bot | ||
GIT_AUTHOR_EMAIL: [email protected] | ||
GIT_COMMITTER_NAME: translation bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
PAGES_REPO_NWO: QubesOS/qubesos.github.io | ||
TRANSLATED_LANGS: de fr es | ||
LANG: C.UTF-8 | ||
before_script: | ||
- mkdir -p $HOME/.ssh && echo "$GITHUB_KEY" > $HOME/.ssh/id_ed25519 && chmod 700 $HOME/.ssh/id_ed25519 | ||
- echo "github.com,140.82.121.4 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> $HOME/.ssh/known_hosts | ||
- export PATH=$PATH:$HOME/bin | ||
- sudo dnf install -y python3-pycurl python3-PyYAML python3-jsonschema python3-certifi python3-attrs /usr/bin/bundle rubygem-jekyll rubygem-nokogiri rubygem-concurrent-ruby ruby-devel gcc-c++ transifex-client crudini python3-pycurl python3-pyrsistent | ||
- pip install python-frontmatter | ||
- export NOKOGIRI_USE_SYSTEM_LIBRARIES=true | ||
- gem install github-pages json html-proofer | ||
- git submodule update --init | ||
script: | ||
- _utils/transifex-push | ||
- _utils/transifex-pull $TRANSLATED_LANGS | ||
after_script: | ||
- tar czf site.tar.gz _site |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../_translated/de/_data/de |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../_translated/es/_data/es |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../_translated/fr/_data/fr |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
current counter: 251 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we be sure that this value is correct once the PR is merged? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'll rerun the script shortly after merging again. And generally, once it lands in master, the script will be called frequently. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# to be run from the git root | ||
# $1 is directory where translated files reside and language needs to be added to internal urls | ||
# TODO param check | ||
|
||
set -e | ||
|
||
echo "================================= build site ==================================" | ||
#read b | ||
bundle exec jekyll b | ||
|
||
all_ok=true | ||
echo "================================= run htmlproofer ===============================" | ||
htmlproofer ./_site --disable-external --checks-to-ignore ImageCheck --file-ignore "./_site/video-tours/index.html,./_site/.*/video-tours/index.html" --url-ignore "/qubes-issues/" --log-level debug 2&> /tmp/html.output || all_ok=false | ||
|
||
# exit here if all is ok | ||
if $all_ok; then | ||
echo 'All checks passed!' | ||
exit | ||
fi | ||
|
||
echo "================================== as a last resort in case of errors process html proofer errors =================================" | ||
python3 _utils/_translation_utils/postprocess_htmlproofer.py /tmp/html.output "$1" | ||
|
||
echo "================================= build the site and run htmlproofer ====================================" | ||
rm -rf ./_site/ | ||
bundle exec jekyll b | ||
htmlproofer ./_site --disable-external --checks-to-ignore ImageCheck --file-ignore "./_site/video-tours/index.html,./_site/.*/video-tours/index.html" --url-ignore "/qubes-issues/" --log-level debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would start with
en
only for now. This way, we could test the workflow on the live system.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the plan. Adding those extra languages is a part of the "[DO NOT MERGE] enable languages: de fr es" commit.