Skip to content

Commit

Permalink
[FLINK-34362][docs] Add argument to skip integrate connector docs in …
Browse files Browse the repository at this point in the history
…setup_docs.sh to improve build times

This closes #24271
  • Loading branch information
swuferhong authored Feb 26, 2024
1 parent 26b1d1b commit a95b0fb
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Then build the docs from source:
$ ./build_docs.sh
```

The shell `./build_docs.sh` will integrate external connector docs, referencing `setup_docs.sh#integrate_connector_docs`.
This process involves cloning the repo of some external connectors, which can be time-consuming and prone to network issues.
So, if the connector docs have been synced before, and you wish to skip this step, you can do so by adding the following arg:

```sh
$ ./build_docs.sh --skip-integrate-connector-docs
```

The site can be viewed at http://localhost:1313/

## Include externally hosted documentation
Expand Down
15 changes: 14 additions & 1 deletion docs/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ then
exit 1
fi
git submodule update --init --recursive
./setup_docs.sh

# whether to skip integrate connector docs. If contains arg '--skip-integrate-connector-docs' and
# the connectors directory is not empty, the external connector docs will not be generated.
connectors_dir="./themes/connectors"
SKIP_INTEGRATE_CONNECTOR_DOCS=""
for arg in "$@"; do
if [ -d "$connectors_dir" ] && [ "$arg" == "--skip-integrate-connector-docs" ]; then
SKIP_INTEGRATE_CONNECTOR_DOCS="--skip-integrate-connector-docs"
break
fi
done

./setup_docs.sh $SKIP_INTEGRATE_CONNECTOR_DOCS

hugo mod get -u
hugo -b "" serve
47 changes: 28 additions & 19 deletions docs/setup_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,33 @@ function integrate_connector_docs {
}


SKIP_INTEGRATE_CONNECTOR_DOCS=false
for arg in "$@"; do
if [ "$arg" == "--skip-integrate-connector-docs" ]; then
SKIP_INTEGRATE_CONNECTOR_DOCS=true
break
fi
done

# Integrate the connector documentation
if [ "$SKIP_INTEGRATE_CONNECTOR_DOCS" = false ]; then
rm -rf themes/connectors/*
rm -rf tmp
mkdir tmp
cd tmp

integrate_connector_docs elasticsearch v3.0
integrate_connector_docs aws v4.2
integrate_connector_docs cassandra v3.1
integrate_connector_docs pulsar v4.0
integrate_connector_docs jdbc v3.1
integrate_connector_docs rabbitmq v3.0
integrate_connector_docs gcp-pubsub v3.0
integrate_connector_docs mongodb v1.1
integrate_connector_docs opensearch v1.1
integrate_connector_docs kafka v3.0
integrate_connector_docs hbase v3.0

rm -rf themes/connectors/*
rm -rf tmp
mkdir tmp
cd tmp

integrate_connector_docs elasticsearch v3.0
integrate_connector_docs aws v4.2
integrate_connector_docs cassandra v3.1
integrate_connector_docs pulsar v4.0
integrate_connector_docs jdbc v3.1
integrate_connector_docs rabbitmq v3.0
integrate_connector_docs gcp-pubsub v3.0
integrate_connector_docs mongodb v1.1
integrate_connector_docs opensearch v1.1
integrate_connector_docs kafka v3.0
integrate_connector_docs hbase v3.0

cd ..
rm -rf tmp
cd ..
rm -rf tmp
fi

0 comments on commit a95b0fb

Please sign in to comment.