未验证 提交 391d8303 编写于 作者: D Daniel Vaz Gaspar 提交者: GitHub

[release] Fix, update superset docs process (#8680)

Introduces some automation on superset doc's build using docker
上级 4e998be6
#
# 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.
#
FROM python:3.6-jessie
ARG VERSION
RUN git clone --depth 1 --branch ${VERSION} https://github.com/apache/incubator-superset.git /superset
WORKDIR /superset
# install doc dependencies
RUN pip install -r requirements.txt \
&& pip install -r docs/requirements.txt
# build the docs
RUN python setup.py build_sphinx
COPY make_docs_entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
......@@ -303,26 +303,14 @@ Every once in a while we want to compile the documentation and publish it.
Here's how to do it.
```bash
# install doc dependencies
pip install -r docs/requirements.txt
# build the docs
python setup.py build_sphinx
# copy html files to temp folder
cp -r docs/_build/html/ /tmp/tmp_superset_docs/
# clone the docs repo
cd ~/
git clone https://git-wip-us.apache.org/repos/asf/incubator-superset-site.git
./make_docs.sh
```
# copy
cp -r /tmp/tmp_superset_docs/ ~/incubator-superset-site.git/
Superset documentation site is ready at http://localhost:5002
# commit and push to `asf-site` branch
cd ~/incubator-superset-site.git/
git checkout asf-site
git add .
git commit -a -m "New doc version"
git push origin master
```
$ cd /tmp/incubator-superset-site-${SUPERSET_VERSION}
$ git add .
$ git commit -a -m "New doc version ${SUPERSET_VERSION}"
$ git push origin asf-site
```
#!/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
DOCKER_TMP_ASF_SITE_PATH=/asf-site
DOC_SITE_PORT=5002
# Clean tmp dir
if [[ -d "${SUPERSET_TMP_ASF_SITE_PATH}" ]]; then
rm -rf "${SUPERSET_TMP_ASF_SITE_PATH}"
fi
mkdir -p "${SUPERSET_TMP_ASF_SITE_PATH}"
# Building docker that will help update superset asf-site
docker build --no-cache -t apache-docs \
--build-arg VERSION="${SUPERSET_VERSION}" \
-f Dockerfile.make_docs .
# Running docker to update superset asf-site
docker run \
-v "${SUPERSET_TMP_ASF_SITE_PATH}":"${DOCKER_TMP_ASF_SITE_PATH}":rw \
-e HOST_UID=${UID} \
-p ${DOC_SITE_PORT}:8000 \
-d \
-ti apache-docs
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo Updating and launching documentation site failed
echo tip: Check if other container is using port:$DOC_SITE_PORT
exit 1
fi
echo "---------------------------------------------------"
echo Superset documentation site is ready at http://localhost:5002
echo Check it out and if all looks good:
echo $ cd "${SUPERSET_TMP_ASF_SITE_PATH}"
echo $ git add .
echo $ git commit -a -m \"New doc version "${SUPERSET_VERSION}"\"
echo $ git push origin asf-site
#!/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
git clone --branch asf-site https://git-wip-us.apache.org/repos/asf/incubator-superset-site.git /asf-site
# copy html files to temp folder
cp -rv /superset/docs/_build/html/* /asf-site
chown -R ${HOST_UID}:${HOST_UID} /asf-site
cd /asf-site
python -m http.server
......@@ -30,6 +30,7 @@ else
export SUPERSET_RELEASE_RC=apache-superset-incubating-"${SUPERSET_VERSION_RC}"
export SUPERSET_RELEASE_TARBALL="${SUPERSET_RELEASE}"-source.tar.gz
export SUPERSET_RELEASE_RC_TARBALL="${SUPERSET_RELEASE_RC}"-source.tar.gz
export SUPERSET_TMP_ASF_SITE_PATH="/tmp/incubator-superset-site-${SUPERSET_VERSION}"
echo -------------------------------
echo Set Release env variables
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册