chore(v1): upgrade v1 Crowdin cli + CI config (#4040)

* Upgrade Crowdin cli for v1 site: cli v2->v3 + simplify install through npm instead of .deb

* add netlify.toml in v1 site

* trigger ci

* netlify

* netlify

* netlify
This commit is contained in:
Sébastien Lorber 2021-01-13 18:29:41 +01:00 committed by GitHub
parent 18002ed573
commit e72869fc8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 36 deletions

View file

@ -81,22 +81,22 @@ jobs:
if ! git diff-tree --no-commit-id --name-only -r HEAD | grep -E "(^docs\/.*)|(docusaurus-1\.x\/.*)|(website-1\.x\/.*)"; then
echo "Skipping deploy. No relevant v1 website files have changed"
elif [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
echo "Deploying website..."
echo "Deploying website v1..."
cd website-1.x
# install Docusaurus and generate file of English strings
cd website-1.x && yarn run write-translations
# install Crowdin
sudo apt-get update
sudo apt-get install default-jre rsync
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
sleep 5
yarn run write-translations
# upload translation strings and download translations
yarn run crowdin-upload
yarn crowdin-upload
# download only enabled languages
for lang in fr ko ru ro pt-BR zh-CN
do
yarn crowdin-download -l $lang
done
yarn crowdin-download
# for lang in fr ko ru ro pt-BR zh-CN
# do
# yarn crowdin-download -l $lang
# done
# publish
GIT_USER=docusaurus-bot USE_SSH=false yarn run publish-gh-pages
else
@ -119,4 +119,4 @@ workflows:
- deploy-website:
requires:
- tests
filters: *filter-only-master
filters: *filter-only-master

View file

@ -1,6 +1,6 @@
project_identifier_env: CROWDIN_DOCUSAURUS_PROJECT_ID
api_key_env: CROWDIN_DOCUSAURUS_API_KEY
base_path: "./"
project_id: '290988'
api_token_env: 'CROWDIN_PERSONAL_TOKEN'
base_path: "."
preserve_hierarchy: true
files:
@ -9,30 +9,13 @@ files:
translation: '/website-1.x/translated_docs/%locale%/**/%original_file_name%'
languages_mapping: &anchor
locale:
'af': 'af'
'ar': 'ar'
'bs-BA': 'bs-BA'
'ca': 'ca'
'cs': 'cs'
'da': 'da'
'de': 'de'
'el': 'el'
'es-ES': 'es-ES'
'fa': 'fa-IR'
'fi': 'fi'
'fr': 'fr'
'he': 'he'
'hu': 'hu'
'id': 'id-ID'
'it': 'it'
'ja': 'ja'
'ko': 'ko'
'mr': 'mr-IN'
'nl': 'nl'
'no': 'no-NO'
'pl': 'pl'
'pt-BR': 'pt-BR'
'pt-PT': 'pt-PT'
'ro': 'ro'
'ru': 'ru'
'sk': 'sk-SK'

10
website-1.x/netlify.toml Normal file
View file

@ -0,0 +1,10 @@
# Note: this file's config override the Netlify UI admin config
[build]
base = "/"
command = "yarn workspace docusaurus-1-website netlify:build"
publish = "website-1.x/build/docusaurus"
[context.production]
command = "yarn workspace docusaurus-1-website netlify:build:production"

View file

@ -10,8 +10,10 @@
"write-translations": "docusaurus-write-translations",
"docusaurus-version": "docusaurus-version",
"rename-version": "docusaurus-rename-version",
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master"
"crowdin-upload": "cd .. && crowdin upload sources --auto-update -b master --config crowdin-v1.yml",
"crowdin-download": "cd .. && crowdin download -b master --config crowdin-v1.yml",
"netlify:build": "yarn build",
"netlify:build:production": "yarn crowdin download && yarn build"
},
"dependencies": {
"docusaurus": "2.0.0-alpha.70"