This is an automated email from the ASF dual-hosted git repository.
caishunfeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler-website.git
The following commit(s) were added to refs/heads/master by this push:
new 47e16dbda [ci] prepare_doc compatible version below bash 4 (#781)
47e16dbda is described below
commit 47e16dbda97079768bb3b170eda3ac4b81560660
Author: Jiajie Zhong <[email protected]>
AuthorDate: Wed Apr 27 15:37:54 2022 +0800
[ci] prepare_doc compatible version below bash 4 (#781)
* [ci] prepare_doc compatible version below bash 4
* change docs
---
README.md | 4 +++-
scripts/conf.sh | 11 ++++++-----
scripts/rsync_content.sh | 7 +++++--
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 7cce9b86c..52aa76a26 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,9 @@ node version is 10+, version lower than 10.x is not supported
yet.
## Build Website Locally
1. Run `npm install` in the root directory to install the dependencies.
-2. Run `./scripts/prepare_docs.sh` prepare all related resources, for more
information you could see [how prepare script work](HOW_PREPARE_WOKR.md)
+2. Run commands to collect resources
+ 2.1. Run `export PROTOCOL_MODE=ssh` tells Git clone resource via SSH
protocol instead of HTTPS protocol
+ 2.2. Run `./scripts/prepare_docs.sh` prepare all related resources, for
more information you could see [how prepare script work](HOW_PREPARE_WOKR.md)
3. Run `npm run start` in the root directory to start a local server, you will
see the website in 'http://localhost:8080'.
```
diff --git a/scripts/conf.sh b/scripts/conf.sh
index 4e3be27c7..998d49b64 100644
--- a/scripts/conf.sh
+++ b/scripts/conf.sh
@@ -36,10 +36,11 @@ declare -a HISTORY_DOCS_VERSIONS=(
"2.0.0" "2.0.1" "2.0.2" "2.0.3" "2.0.5"
)
+# NOTE: We should avoid use syntax `declare -A
DEV_RELEASE_DOCS_VERSIONS=(["3.0.0"]="3.0.0-alpha-release")` because
+# option `-A` only works on bash versions above bash 4
# docs in apache/dolphinscheduler directory `docs` after 3.0.0-alpha(the time
we migrate docs to this repo)
-declare -A DEV_RELEASE_DOCS_VERSIONS=(
- # The key value is represents of version `key` document is from tag `val`
from apache/dolphinscheduler
- # example: ["key"]="val"
- ["3.0.0"]="3.0.0-alpha-release"
+DEV_RELEASE_DOCS_VERSIONS=(
+ # The key value is represents of, `key` for document version and `val` for
source branch apache/dolphinscheduler.
+ # example: "key:val"
+ "3.0.0:3.0.0-alpha-release"
)
-
diff --git a/scripts/rsync_content.sh b/scripts/rsync_content.sh
index 346849f05..794dd3398 100644
--- a/scripts/rsync_content.sh
+++ b/scripts/rsync_content.sh
@@ -88,9 +88,12 @@ function rsync_released_docs() {
echo " ---> Directory change to ${PROJECT_DIR}."
cd "${PROJECT_DIR}"
- for version in "${!DEV_RELEASE_DOCS_VERSIONS[@]}"; do
+ for version_branch in "${DEV_RELEASE_DOCS_VERSIONS[@]}"; do
+ local version="${version_branch%%:*}"
+ local branch="${version_branch##*:}"
+
echo " ---> Git checkout to version ${version}."
- git fetch origin "${DEV_RELEASE_DOCS_VERSIONS[$version]}" --no-tags
+ git fetch origin "${branch}" --no-tags
git checkout -b "${version}" FETCH_HEAD
echo " ---> Sync released version ${version} docs."