From c34fb69b2d7e7781ccf362dbca8b2226bea0a1bf Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 13 Jan 2021 17:34:40 +0100 Subject: [PATCH 1/6] Upgrade Crowdin cli for v1 site: cli v2->v3 + simplify install through npm instead of .deb --- .circleci/config.yml | 28 ++++++++++++++-------------- crowdin.yaml => crowdin-v1.yml | 23 +++-------------------- website-1.x/package.json | 4 ++-- 3 files changed, 19 insertions(+), 36 deletions(-) rename crowdin.yaml => crowdin-v1.yml (65%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94b29e9786e4..987f4b8674df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 \ No newline at end of file + filters: *filter-only-master diff --git a/crowdin.yaml b/crowdin-v1.yml similarity index 65% rename from crowdin.yaml rename to crowdin-v1.yml index d9cf38c810db..510a92013700 100644 --- a/crowdin.yaml +++ b/crowdin-v1.yml @@ -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' diff --git a/website-1.x/package.json b/website-1.x/package.json index 7340ef03519f..1b588b73d31b 100644 --- a/website-1.x/package.json +++ b/website-1.x/package.json @@ -10,8 +10,8 @@ "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" }, "dependencies": { "docusaurus": "2.0.0-alpha.70" From 05287a4d351d55d40f71cb22a3aaeae31d35c260 Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 13 Jan 2021 17:39:27 +0100 Subject: [PATCH 2/6] add netlify.toml in v1 site --- website-1.x/netlify.toml | 12 ++++++++++++ website-1.x/package.json | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 website-1.x/netlify.toml diff --git a/website-1.x/netlify.toml b/website-1.x/netlify.toml new file mode 100644 index 000000000000..0c14b471bc39 --- /dev/null +++ b/website-1.x/netlify.toml @@ -0,0 +1,12 @@ + +# Note: this file's config override the Netlify UI admin config + +# default/production build +[build] + base = "/" + command = "yarn workspace docusaurus-1-website netlify:build:production" + publish = "website-1.x/build/docusaurus" + +[context.deploy-preview] + command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" + diff --git a/website-1.x/package.json b/website-1.x/package.json index 1b588b73d31b..72b82b99ac7e 100644 --- a/website-1.x/package.json +++ b/website-1.x/package.json @@ -11,7 +11,9 @@ "docusaurus-version": "docusaurus-version", "rename-version": "docusaurus-rename-version", "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" + "crowdin-download": "cd .. && crowdin download -b master --config crowdin-v1.yml", + "netlify:build:production": "yarn crowdin download && yarn build", + "netlify:build:deployPreview": "yarn build" }, "dependencies": { "docusaurus": "2.0.0-alpha.70" From 20bb747c44c7c5bda3b70aa26a6872cdf3ea5157 Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 13 Jan 2021 17:54:35 +0100 Subject: [PATCH 3/6] trigger ci --- website-1.x/netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/website-1.x/netlify.toml b/website-1.x/netlify.toml index 0c14b471bc39..2e7e26c23b2e 100644 --- a/website-1.x/netlify.toml +++ b/website-1.x/netlify.toml @@ -10,3 +10,4 @@ [context.deploy-preview] command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" + From e27dbee2d392919fac51caa8b4f7bdb01114e455 Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 13 Jan 2021 18:01:28 +0100 Subject: [PATCH 4/6] netlify --- website-1.x/netlify.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website-1.x/netlify.toml b/website-1.x/netlify.toml index 2e7e26c23b2e..c43dd4922ee3 100644 --- a/website-1.x/netlify.toml +++ b/website-1.x/netlify.toml @@ -8,6 +8,8 @@ publish = "website-1.x/build/docusaurus" [context.deploy-preview] + base = "/" command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" + publish = "website-1.x/build/docusaurus" From 3ee4cb39556caded36f7aaf8c8b5a2977c785425 Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 13 Jan 2021 18:04:05 +0100 Subject: [PATCH 5/6] netlify --- website-1.x/netlify.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website-1.x/netlify.toml b/website-1.x/netlify.toml index c43dd4922ee3..0e6b4ec553ee 100644 --- a/website-1.x/netlify.toml +++ b/website-1.x/netlify.toml @@ -1,10 +1,9 @@ # Note: this file's config override the Netlify UI admin config -# default/production build [build] base = "/" - command = "yarn workspace docusaurus-1-website netlify:build:production" + command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" publish = "website-1.x/build/docusaurus" [context.deploy-preview] @@ -12,4 +11,5 @@ command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" publish = "website-1.x/build/docusaurus" - +[context.production] + command = "yarn workspace docusaurus-1-website netlify:build:production" From 48ef7ac8098bd4daac054308ac299efd3f542fb5 Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 13 Jan 2021 18:12:17 +0100 Subject: [PATCH 6/6] netlify --- website-1.x/netlify.toml | 7 +------ website-1.x/package.json | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/website-1.x/netlify.toml b/website-1.x/netlify.toml index 0e6b4ec553ee..5162b2c68f3d 100644 --- a/website-1.x/netlify.toml +++ b/website-1.x/netlify.toml @@ -3,12 +3,7 @@ [build] base = "/" - command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" - publish = "website-1.x/build/docusaurus" - -[context.deploy-preview] - base = "/" - command = "yarn workspace docusaurus-1-website netlify:build:deployPreview" + command = "yarn workspace docusaurus-1-website netlify:build" publish = "website-1.x/build/docusaurus" [context.production] diff --git a/website-1.x/package.json b/website-1.x/package.json index 72b82b99ac7e..4749764e3649 100644 --- a/website-1.x/package.json +++ b/website-1.x/package.json @@ -12,8 +12,8 @@ "rename-version": "docusaurus-rename-version", "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:production": "yarn crowdin download && yarn build", - "netlify:build:deployPreview": "yarn build" + "netlify:build": "yarn build", + "netlify:build:production": "yarn crowdin download && yarn build" }, "dependencies": { "docusaurus": "2.0.0-alpha.70"