Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] prepare_doc compatible version below bash 4 #781

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'.

```
Expand Down
11 changes: 6 additions & 5 deletions scripts/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

7 changes: 5 additions & 2 deletions scripts/rsync_content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down