Resolve comments

pull/24060/head
Lidi Zheng 4 years ago
parent 4511738d18
commit c220cf1224
  1. 3
      tools/distrib/docgen/_generate_python_doc.sh
  2. 10
      tools/distrib/docgen/all_lang_docgen.sh

@ -20,9 +20,8 @@ set -ex
# Some Python package installation requires permission to change homedir. But # Some Python package installation requires permission to change homedir. But
# due to the user-override in all_lang_docgen.sh, the user in the container # due to the user-override in all_lang_docgen.sh, the user in the container
# doesn't have a home dir which leads to permission denied error. # doesn't have a home dir which leads to permission denied error.
HOME="/tmp/$(id -u)" HOME="$(mktemp -d)"
export HOME export HOME
mkdir -p "${HOME}"
pip install -r requirements.bazel.txt pip install -r requirements.bazel.txt
tools/run_tests/run_tests.py -c opt -l python --compiler python3.8 --newline_on_success -j 8 --build_only tools/run_tests/run_tests.py -c opt -l python --compiler python3.8 --newline_on_success -j 8 --build_only

@ -30,12 +30,12 @@
set -e set -e
# Find out the gRPC version and print it # Find out the gRPC version and print it
GRPC_VERSION="$(grep -m1 -Eo ' version: .*' build_handwritten.yaml | grep -Eo '[0-9].*')" GRPC_VERSION="$(grep -m1 -Eo ' version: .*' build_handwritten.yaml | grep -Eo '[0-9][^ ]*')"
echo "Generating documents for version ${GRPC_VERSION}..." echo "Generating documents for version ${GRPC_VERSION}..."
# Specifies your GitHub user name or generates documents locally # Specifies your GitHub user name or generates documents locally
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
read -r -p "- Are you sure to generate documents without push to GitHub? [y/N] " response read -r -p "- Are you sure to generate documents without pushing to GitHub? [y/N] " response
if [[ "${response[0]}" =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ "${response[0]}" =~ ^([yY][eE][sS]|[yY])$ ]]; then
GITHUB_USER='' GITHUB_USER=''
else else
@ -62,7 +62,7 @@ cd "${dir}/../../.."
# Clones the API reference GitHub Pages branch # Clones the API reference GitHub Pages branch
PAGES_PATH="/tmp/gh-pages" PAGES_PATH="/tmp/gh-pages"
rm -rf "${PAGES_PATH}" rm -rf "${PAGES_PATH}"
git clone https://github.com/grpc/grpc -b gh-pages "${PAGES_PATH}" git clone --depth 1 https://github.com/grpc/grpc -b gh-pages "${PAGES_PATH}"
# Generates Core / C++ / ObjC / PHP documents # Generates Core / C++ / ObjC / PHP documents
rm -rf "${PAGES_PATH}/core" "${PAGES_PATH}/cpp" "${PAGES_PATH}/objc" "${PAGES_PATH}/php" rm -rf "${PAGES_PATH}/core" "${PAGES_PATH}/cpp" "${PAGES_PATH}/objc" "${PAGES_PATH}/php"
@ -102,13 +102,13 @@ echo "================================================================="
if [[ -n "${GITHUB_USER}" ]]; then if [[ -n "${GITHUB_USER}" ]]; then
BRANCH_NAME="doc-${GRPC_VERSION}" BRANCH_NAME="doc-${GRPC_VERSION}"
cd "${PAGES_PATH}" (cd "${PAGES_PATH}"
git remote add "${GITHUB_USER}" "git@github.com:${GITHUB_USER}/grpc.git" git remote add "${GITHUB_USER}" "git@github.com:${GITHUB_USER}/grpc.git"
git checkout -b "${BRANCH_NAME}" git checkout -b "${BRANCH_NAME}"
git add --all git add --all
git commit -m "Auto-update documentation for gRPC ${GRPC_VERSION}" git commit -m "Auto-update documentation for gRPC ${GRPC_VERSION}"
git push --set-upstream "${GITHUB_USER}" "${BRANCH_NAME}" git push --set-upstream "${GITHUB_USER}" "${BRANCH_NAME}"
cd - )
echo "Please check https://github.com/${GITHUB_USER}/grpc/tree/${BRANCH_NAME} for generated documents." echo "Please check https://github.com/${GITHUB_USER}/grpc/tree/${BRANCH_NAME} for generated documents."
echo "Click https://github.com/grpc/grpc/compare/gh-pages...${GITHUB_USER}:${BRANCH_NAME} to create a PR." echo "Click https://github.com/grpc/grpc/compare/gh-pages...${GITHUB_USER}:${BRANCH_NAME} to create a PR."

Loading…
Cancel
Save