[docs] Support build document website locally
parent
4b2116bdd3
commit
0c5cb6bf06
@ -0,0 +1,6 @@
|
|||||||
|
FROM python:3.7-slim
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get -y install git
|
||||||
|
RUN pip3 install -U sphinx==4.1.1 myst-parser pygments sphinx-rtd-theme sphinx-autobuild gitpython
|
||||||
|
EXPOSE 8001
|
||||||
|
CMD ["sphinx-autobuild", "--host", "0.0.0.0", "--port", "8001", "/home/flink-cdc/docs", "/home/flink-cdc/docs/_build/html"]
|
@ -0,0 +1,17 @@
|
|||||||
|
This README gives an overview of how to build the documentation of Flink CDC.
|
||||||
|
|
||||||
|
### Build the site locally
|
||||||
|
Make sure you have installed [Docker](https://docs.docker.com/engine/install/) and started it on you local environment.
|
||||||
|
|
||||||
|
From the directory of this module (`docs`), use the following command to start the site.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./docs_site.sh start
|
||||||
|
```
|
||||||
|
Then the site will run and can be viewed at http://localhost:8001, any update on the `docs` will be shown in the site without restarting.
|
||||||
|
|
||||||
|
Of course, you can use the following command to stop the site.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./docs_site.sh stop
|
||||||
|
```
|
@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
################################################################################
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
docs_container_name="flink-cdc-docs_container"
|
||||||
|
docs_image_name="flink-cdc-docs"
|
||||||
|
port=8001
|
||||||
|
host=localhost
|
||||||
|
|
||||||
|
function start_docs_server() {
|
||||||
|
project_dir="$(dirname "$(pwd)")"
|
||||||
|
echo "starting docs server....."
|
||||||
|
docker build -t ${docs_image_name} -f ${project_dir}/docs/Dockerfile .
|
||||||
|
docker run -d -it -p ${port}:${port} --rm -v "${project_dir}":/home/flink-cdc --name ${docs_container_name} ${docs_image_name}
|
||||||
|
echo "docs server is running on http://${host}:${port}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function stop_docs_server() {
|
||||||
|
echo "stopping docs server....."
|
||||||
|
docker stop ${docs_container_name}
|
||||||
|
echo "stop docs server successfully."
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! command -v docker &> /dev/null
|
||||||
|
then
|
||||||
|
echo "Docker must be installed to run the docs locally"
|
||||||
|
echo "Please see docs/README.md for more details"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 = "start" ]]; then
|
||||||
|
start_docs_server
|
||||||
|
elif [[ $1 = "stop" ]]; then
|
||||||
|
stop_docs_server
|
||||||
|
else
|
||||||
|
echo "Usage:"
|
||||||
|
echo "$0 start"
|
||||||
|
echo "$0 stop"
|
||||||
|
fi
|
Loading…
Reference in New Issue