Skip to content

Commit

Permalink
[FLINK-29957][docs] Rework connector docs integration
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Nov 10, 2022
1 parent 194df8d commit d8e8993
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
28 changes: 22 additions & 6 deletions docs/setup_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions docs/themes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connectors/

0 comments on commit d8e8993

Please sign in to comment.