You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/03/14 09:49:25 UTC

[shardingsphere] branch master updated: Add : add build with docker shell (#24593)

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

zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 882cc9b441d Add : add build with docker shell (#24593)
882cc9b441d is described below

commit 882cc9b441d5ab45e17aa2920d641bd87d04619f
Author: 孙念君 Nianjun Sun <su...@apache.org>
AuthorDate: Tue Mar 14 17:49:17 2023 +0800

    Add : add build with docker shell (#24593)
---
 docs/README.md            |  2 +-
 docs/build-with-docker.sh | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/docs/README.md b/docs/README.md
index 925ae146a34..4040fac6426 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -23,7 +23,7 @@ Follow the steps below to deploy ShardingSphere website,
 > shardingsphere-doc support docker hugo to build the website, you can use the following command to build:
 > 1. Go to the root directory of `shardingsphere-doc`
 > 2. Execute docker build command `docker build .github/docker/ -t docker-hugo:latest`
-> 3. Execute `build-with-docker.sh` in shardingsphere-doc/.github/docker/ like `build.sh`
+> 3. Execute `build-with-docker.sh` like `build.sh`
 > 4. If test it locally, go to the directory container config.toml and execute command `docker run --rm -it -p1313:1313 --volume $(pwd):/opt/input docker-hugo:latest server --bind 0.0.0.0`
 
  ‍
diff --git a/docs/build-with-docker.sh b/docs/build-with-docker.sh
new file mode 100644
index 00000000000..bd88b07d357
--- /dev/null
+++ b/docs/build-with-docker.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+cd `dirname $0`
+
+rm -rf target
+
+mkdir -p target/document/current
+cd document
+docker run --rm -it --volume $(pwd):/opt/input docker-hugo:latest
+find ../document/public/ -name '*.html' -exec sed -i -e 's|[[:space:]]*<option id="\([a-zA-Z]\+\)" value="|<option id="\1" value="/document/current|g' {} \;
+cd public/en
+sed -i -e 's/cn/en/g' index.html
+cd ../..
+cd ..
+mv document/public/* target/document/current
+
+mkdir target/community
+cd community
+docker run --rm -it --volume $(pwd):/opt/input docker-hugo:latest
+find ../community/public/ -name '*.html' -exec sed -i -e 's|[[:space:]]*<option id="\([a-zA-Z]\+\)" value="|<option id="\1" value="/community|g' {} \;
+cd public/en
+sed -i -e 's/cn/en/g' index.html
+cd ../..
+cd ..
+mv community/public/* target/community/
+
+mkdir target/blog
+cd blog
+docker run --rm -it --volume $(pwd):/opt/input docker-hugo:latest
+find ../blog/public/ -name '*.html' -exec sed -i -e 's|[[:space:]]*<option id="\([a-zA-Z]\+\)" value="|<option id="\1" value="/blog|g' {} \;
+cd public/en
+sed -i -e 's/cn/en/g' index.html
+cd ../..
+cd ..
+mv blog/public/* target/blog/