You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/03/25 03:44:02 UTC
[pulsar-site] branch fix/crowdin-action-optimize updated: feat: crowdin-upload and crowdin-download are executed at different times and only once a day
This is an automated email from the ASF dual-hosted git repository.
urfree pushed a commit to branch fix/crowdin-action-optimize
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/fix/crowdin-action-optimize by this push:
new 029b4b4 feat: crowdin-upload and crowdin-download are executed at different times and only once a day
029b4b4 is described below
commit 029b4b42c446f2a430312b9bcf4821375c1497d9
Author: LiLi <ur...@apache.org>
AuthorDate: Fri Mar 25 11:43:30 2022 +0800
feat: crowdin-upload and crowdin-download are executed at different times and only once a day
Signed-off-by: LiLi <ur...@apache.org>
---
site2/tools/build-site.sh | 3 +++
site2/website-next/.gitignore | 2 --
site2/website-next/scripts/.gitignore | 5 ++++-
site2/website-next/scripts/split-version-build.sh | 13 ++++++++++++-
site2/website-next/versions.json | 2 +-
5 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/site2/tools/build-site.sh b/site2/tools/build-site.sh
index b18a8b2..efeadfe 100755
--- a/site2/tools/build-site.sh
+++ b/site2/tools/build-site.sh
@@ -107,6 +107,9 @@ if [ -n "$NEXT" ]; then
fi
if [[ "$CROWDIN_DOWNLOAD" == "1" || $CURRENT_HOUR -gt 12 ]]; then
yarn crowdin-download
+ echo 'all' > scripts/.language
+ else
+ echo 'en' > scripts/.language
fi
node scripts/replace.js
diff --git a/site2/website-next/.gitignore b/site2/website-next/.gitignore
index 834568c..e03892c 100644
--- a/site2/website-next/.gitignore
+++ b/site2/website-next/.gitignore
@@ -20,7 +20,5 @@ yarn-debug.log*
yarn-error.log*
bak/
-.latest
-.versions
i18n/*
\ No newline at end of file
diff --git a/site2/website-next/scripts/.gitignore b/site2/website-next/scripts/.gitignore
index 1c0f705..e028abc 100644
--- a/site2/website-next/scripts/.gitignore
+++ b/site2/website-next/scripts/.gitignore
@@ -1,2 +1,5 @@
release-notes/
-token
\ No newline at end of file
+token
+.latest
+.versions
+.language
\ No newline at end of file
diff --git a/site2/website-next/scripts/split-version-build.sh b/site2/website-next/scripts/split-version-build.sh
index 9ba56b9..603aef6 100755
--- a/site2/website-next/scripts/split-version-build.sh
+++ b/site2/website-next/scripts/split-version-build.sh
@@ -3,17 +3,28 @@
node scripts/split-version.js
latest=$(cat scripts/.latest)
+language=$(cat scripts/.language)
echo "changed files: "
echo $@
+function _build() {
+ if [[ "$language" == "en" ]]; then
+ echo "only build en"
+ yarn build --locale en
+ else
+ echo "build all"
+ yarn build
+ fi
+}
+
locals=("en" "zh-CN" "zh-TW" "ja" "ko" "fr")
while read version; do
if [[ $@ == *website-next/versioned_docs/version-$version* ]]; then
echo $version "has changed, begin rebuild..."
echo "[\"${latest}\", \"${version}\"]" >versions.json
- yarn build
+ _build
mkdir -p build-${version}/${version} build-${version}/${version}.md
cp -r build/docs/${version}/* build-${version}/${version}
cp -r build/docs/${version}.md/* build-${version}/${version}.md
diff --git a/site2/website-next/versions.json b/site2/website-next/versions.json
index 3c22abe..f829e1e 100644
--- a/site2/website-next/versions.json
+++ b/site2/website-next/versions.json
@@ -1 +1 @@
-["2.9.1", "2.9.0"]
+["2.9.1"]