You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2022/11/10 08:21:26 UTC

[flink] branch release-1.16 updated: [FLINK-29957][docs] Rework connector docs integration

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

chesnay pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.16 by this push:
     new 1b0f50b1f26 [FLINK-29957][docs] Rework connector docs integration
1b0f50b1f26 is described below

commit 1b0f50b1f26513f3ff171426411d75cd424da154
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Thu Nov 10 09:20:55 2022 +0100

    [FLINK-29957][docs] Rework connector docs integration
---
 docs/config.toml       |  2 +-
 docs/setup_docs.sh     | 28 ++++++++++++++++++++++------
 docs/themes/.gitignore |  1 +
 3 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/docs/config.toml b/docs/config.toml
index d938c14433b..c45823886e4 100644
--- a/docs/config.toml
+++ b/docs/config.toml
@@ -112,7 +112,7 @@ pygmentsUseClasses = true
 
 [module]
 [[module.imports]]
-  path = 'github.com/apache/flink-connector-elasticsearch/docs'
+  path = 'connectors'
 [[module.imports.mounts]]
   source = 'content'
   target = 'content'
diff --git a/docs/setup_docs.sh b/docs/setup_docs.sh
index 34f3d59d99c..164e5b39674 100755
--- a/docs/setup_docs.sh
+++ b/docs/setup_docs.sh
@@ -35,9 +35,25 @@ echo "Created temporary file" $goModFileLocation/go.mod
 # Make Hugo retrieve modules which are used for externally hosted documentation
 currentBranch=$(git rev-parse --abbrev-ref HEAD)
 
-if [[ ! "$currentBranch" =~ ^release- ]] || [[ -z "$currentBranch" ]]; then
-  # If the current branch is master or not provided, get the documentation from the main branch
-  $(command -v hugo) mod get -u github.com/apache/flink-connector-elasticsearch/docs@main
-  # Since there's no documentation yet available for a release branch,
-  # we only get the documentation from the main branch
-fi
+function integrate_connector_docs {
+  connector=$1
+  ref=$2
+  git clone --single-branch --branch ${ref} https://github.com/apache/flink-connector-${connector}
+  theme_dir="../themes/connectors"
+  mkdir -p "${theme_dir}"
+  rsync -a flink-connector-${connector}/docs/content* "${theme_dir}/"
+}
+
+# Integrate the connector documentation
+
+rm -rf themes/connectors/*
+rm -rf tmp
+mkdir tmp
+cd tmp
+
+# Since there's no documentation yet available for a release branch,
+# we only get the documentation from the main branch
+integrate_connector_docs elasticsearch main
+
+cd ..
+rm -rf tmp
diff --git a/docs/themes/.gitignore b/docs/themes/.gitignore
new file mode 100644
index 00000000000..5cf335a67c7
--- /dev/null
+++ b/docs/themes/.gitignore
@@ -0,0 +1 @@
+connectors/