同步操作将从 PaddlePaddle/Paddle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.## Licensed 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.is_shell_attribute_set() { # attribute, like "x"case "$-" in*"1ドル"*) return 0 ;;*) return 1 ;;esac}function get_docs_pr_num_from_paddle_pr_info(){# get_repo_pr_info's outputpr_info_file=1ドルif [ ! -r ${pr_info_file} ] ; thenreturn 1fideclare -A arr_kvwhile read linedoecho "$line" | grep '^\w\+\s*=\s*.*' > /dev/nullif [ $? = 0 ] ; thenkv=($(echo $line | sed 's/=/\n/g'))k=($(echo "${kv[0]}" | sed 's/\s//g'))v=($(echo "${kv[1]}" | sed 's/^\s*//g' | sed 's/\s*$//g'))# arr_kv[${kv[1]}]=${kv[2]}arr_kv[${k}]=${v}fidone < <(jq -r '.body' ${pr_info_file})echo ${arr_kv[PADDLEDOCS_PR]}return 0}# Attention:# 1. /FluidDoc will be used as the workspace of PaddlePaddle/docs.# 2. And /docs is used as the output of doc-build process.# 3. If conflicted with yours, please modify the defination of FLUIDDOCDIR and# OUTPUTDIR in the subsequent codes.# 4. The doc-build process is controlled under EnvVar BUILD_DOC and UPLOAD_DOC.# All the Chinese and English docs will be generated, and then uploaded.PREVIEW_URL_PROMPT="ipipe_log_param_preview_url: None"BUILD_DOC=${BUILD_DOC:=false}UPLOAD_DOC=${UPLOAD_DOC:=false}CURPWD=${PWD}if [ -f /usr/local/python3.7.0/bin/sphinx-build ] ; thenif [ -f /usr/local/bin/sphinx-build ] ; thenrm /usr/local/bin/sphinx-buildfiln -s /usr/local/python3.7.0/bin/sphinx-build /usr/local/bin/sphinx-buildfiif [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; thenexport FLUIDDOCDIR=${FLUIDDOCDIR:=/FluidDoc}export OUTPUTDIR=${OUTPUTDIR:=/docs}export VERSIONSTR=$(echo ${BRANCH} | sed 's@release/@@g')if [ -d ${FLUIDDOCDIR} ] ; thenecho "${FLUIDDOCDIR} exists, git clone will be skipped, but git clean will be done."cd ${FLUIDDOCDIR}git reset --hardgit clean -dfxcd ${CURPWD}elsegit clone -b ${BRANCH} --depth=1 https://github.com/PaddlePaddle/docs.git ${FLUIDDOCDIR}if [ ! "$?" = "0" ] ; thengit clone --depth=1 https://github.com/PaddlePaddle/docs.git ${FLUIDDOCDIR}fifiif [ -d ${OUTPUTDIR} ] ; thenecho "0ドル: rm -rf ${OUTPUTDIR}"rm -rf ${OUTPUTDIR}mkdir -p ${OUTPUTDIR}fi# install requirementsexport no_proxy=mirror.baidu.com,${no_proxy}apt-get install -y --no-install-recommends doxygen jqecho 'beautifulsoup4Markdownsphinx-sitemapsphinx-markdown-tablesbreatheexhalesphinx_designnbsphinx' >/tmp/doc-build.requirements && \pip install --no-cache-dir -i https://mirror.baidu.com/pypi/simple -r /tmp/doc-build.requirements && \rm /tmp/doc-build.requirementssource ${FLUIDDOCDIR}/ci_scripts/utils.shpaddle_pr_info=$(get_repo_pr_info "PaddlePaddle/Paddle" ${GIT_PR_ID})docs_pr_id=$(get_docs_pr_num_from_paddle_pr_info ${paddle_pr_info})if [ -n "${docs_pr_id}" ] ; thencd ${FLUIDDOCDIR}git fetch --depth=1 origin pull/${docs_pr_id}/headgit checkout -b "pr${docs_pr_id}" FETCH_HEADgit log --pretty=oneline -10fiecho "docs_pr_id=${docs_pr_id}"# build doc/bin/bash -x ${FLUIDDOCDIR}/ci_scripts/gendoc.shif [ $? -ne 0 ];thenecho 'gendoc error'exit 1fiif [ "${UPLOAD_DOC}" = "true" ] ; thencurl -o /tmp/linux-bcecmd-0.3.0.zip https://sdk.bce.baidu.com/console-sdk/linux-bcecmd-0.3.0.zip && \python -m zipfile -e /tmp/linux-bcecmd-0.3.0.zip /opt && \chmod +x /opt/linux-bcecmd-0.3.0/bcecmd && \rm /tmp/linux-bcecmd-0.3.0.zip && \curl -o /tmp/boscmdconfig.tgz https://paddle-dev-tools-open.bj.bcebos.com/fluiddoc-preview/boscmdconfig.tgz && \tar xzf /tmp/boscmdconfig.tgz -C /opt/linux-bcecmd-0.3.0/ && \rm /tmp/boscmdconfig.tgz# credentials file is empty, please build it if need.BCECMD=/opt/linux-bcecmd-0.3.0/bcecmdBCECMD_CONFIG=/opt/linux-bcecmd-0.3.0/boscmdconfigis_shell_attribute_set xxdebug_setted=$?if [ $xdebug_setted ] ; thenset +xfiif [ -n "${BOS_CREDENTIAL_AK}" ] && [ -n "${BOS_CREDENTIAL_SK}" ] ; thenecho "Ak = ${BOS_CREDENTIAL_AK}" >> ${BCECMD_CONFIG}/credentialsecho "Sk = ${BOS_CREDENTIAL_SK}" >> ${BCECMD_CONFIG}/credentialsfiif [ $xdebug_setted ] ; thenset -xfiPREVIEW_JOB_NAME="preview-paddle-pr-${GIT_PR_ID}"BOSBUCKET=${BOSBUCKET:=paddle-site-web-dev}${BCECMD} --conf-path ${BCECMD_CONFIG} bos sync "${OUTPUTDIR}/en/${VERSIONSTR}" "bos:/${BOSBUCKET}/documentation/en/${PREVIEW_JOB_NAME}" \--delete --yes --exclude "${OUTPUTDIR}/en/${VERSIONSTR}/_sources/"${BCECMD} --conf-path ${BCECMD_CONFIG} bos sync "${OUTPUTDIR}/en/${VERSIONSTR}" "bos:/${BOSBUCKET}/documentation/en/${PREVIEW_JOB_NAME}" \--delete --yes --exclude "${OUTPUTDIR}/en/${VERSIONSTR}/_sources/"${BCECMD} --conf-path ${BCECMD_CONFIG} bos sync "${OUTPUTDIR}/zh/${VERSIONSTR}" "bos:/${BOSBUCKET}/documentation/zh/${PREVIEW_JOB_NAME}" \--delete --yes --exclude "${OUTPUTDIR}/zh/${VERSIONSTR}/_sources/"${BCECMD} --conf-path ${BCECMD_CONFIG} bos sync "${OUTPUTDIR}/zh/${VERSIONSTR}" "bos:/${BOSBUCKET}/documentation/zh/${PREVIEW_JOB_NAME}" \--delete --yes --exclude "${OUTPUTDIR}/zh/${VERSIONSTR}/_sources/"PREVIEW_URL_PROMPT="ipipe_log_param_preview_url: http://${PREVIEW_JOB_NAME}.${PREVIEW_SITE:-paddle.run}/documentation/docs/zh/api/index_cn.html"fificd ${CURPWD}# print the preview urlecho "${PREVIEW_URL_PROMPT}"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。