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/06/30 01:45:25 UTC

[pulsar-site] branch fix/update-build-script-20220630-2 created (now f9a33f901a4)

This is an automated email from the ASF dual-hosted git repository.

urfree pushed a change to branch fix/update-build-script-20220630-2
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


      at f9a33f901a4 feat: add support for force build by parse commit msg

This branch includes the following new commits:

     new f9a33f901a4 feat: add support for force build by parse commit msg

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[pulsar-site] 01/01: feat: add support for force build by parse commit msg

Posted by ur...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

urfree pushed a commit to branch fix/update-build-script-20220630-2
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit f9a33f901a4ff5a4dbb6dd01be2a3e1860b789c9
Author: Li Li <ur...@apache.org>
AuthorDate: Thu Jun 30 09:45:16 2022 +0800

    feat: add support for force build by parse commit msg
    
    Signed-off-by: Li Li <ur...@apache.org>
---
 site2/website-next/scripts/split-version-build.sh | 32 ++++++++++++++++-------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/site2/website-next/scripts/split-version-build.sh b/site2/website-next/scripts/split-version-build.sh
index feed8c54fed..9bafd4fa367 100755
--- a/site2/website-next/scripts/split-version-build.sh
+++ b/site2/website-next/scripts/split-version-build.sh
@@ -49,30 +49,44 @@ function _buildVersion() {
     echo "..." $buildVersion "build done..."
 }
 
+COMMIT_MSG=$(git show -s --format=%s)
+FORCE_BUILD_ALL_LANGUAGE=$(echo $COMMIT_MSG | sed 's/.*BUILD_ALL_LANGUAGE=\([0-1]*\).*/\1/g')
+FORCE_BUILD_ALL_VERSION=$(echo $COMMIT_MSG | sed 's/.*BUILD_ALL_VERSION=\([0-1]*\).*/\1/g')
+FORCE_CROWDIN_ALL=$(echo $COMMIT_MSG | sed 's/.*CROWDIN_ALL=\([0-1]*\).*/\1/g')
+FORCE_CROWDIN_UP=$(echo $COMMIT_MSG | sed 's/.*CROWDIN_UP=\([0-1]*\).*/\1/g')
+FORCE_CROWDIN_DOWN=$(echo $COMMIT_MSG | sed 's/.*CROWDIN_DOWN=\([0-1]*\).*/\1/g')
+
 yarn write-translations
 CURRENT_HOUR=$(date +%H)
 CURRENT_HOUR=${CURRENT_HOUR#0}
-echo "------ crowdin envs:" "CROWDIN_UPLOAD: "$CROWDIN_UPLOAD "CROWDIN_DOWNLOAD: "$CROWDIN_DOWNLOAD "CURRENT_HOUR: "$CURRENT_HOUR
-if [[ $CURRENT_HOUR -eq 0 ]]; then
-    echo "------ exec crowdin upload"
+echo "CURRENT_HOUR: "$CURRENT_HOUR
+if [[ $CURRENT_HOUR -eq 0 ]] || [[ $FORCE_CROWDIN_ALL"" == "1" ]] || [[ $FORCE_CROWDIN_UP"" == "1" ]]; then
+    echo "exec crowdin upload"
     yarn run crowdin-upload
 else
-    echo "------ skip crowdin upload"
+    echo "skip crowdin upload"
 fi
 
-#force set CURRENT_HOUR for testing crowdin download and build all
-# CURRENT_HOUR=18
-if [[ $CURRENT_HOUR -eq 18 ]]; then
-    echo "------ exec crowdin download"
+if [[ $CURRENT_HOUR -eq 18 ]] || [[ $FORCE_CROWDIN_ALL"" == "1" ]] || [[ $FORCE_CROWDIN_DOWN"" == "1" ]]; then
+    echo "exec crowdin download"
     yarn crowdin-download
     BUILD_ALL_LANGUAGE="1"
     BUILD_ALL_VERSION="1"
 else
-    echo "------ skip crowdin download"
+    echo "skip crowdin download"
     BUILD_ALL_LANGUAGE="0"
     BUILD_ALL_VERSION="0"
 fi
 
+if [[ $FORCE_BUILD_ALL_LANGUAGE"" == "1" ]] || [[ $FORCE_BUILD_ALL_LANGUAGE"" == "0" ]]; then
+    BUILD_ALL_LANGUAGE=$FORCE_BUILD_ALL_LANGUAGE""
+    echo "force build all languages"
+fi
+if [[ $FORCE_BUILD_ALL_VERSION"" == "1" ]] || [[ $FORCE_BUILD_ALL_VERSION"" == "0" ]]; then
+    BUILD_ALL_VERSION=$FORCE_BUILD_ALL_VERSION""
+    echo "force build all versions"
+fi
+
 # Build only the versions that has changed
 # Build next version that has any changed
 while read version; do