提交 1a066975 编写于 作者: L Luo Tao

travis for check broken links

上级 f0449b8b
...@@ -56,7 +56,7 @@ before_install: ...@@ -56,7 +56,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
- if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi - if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
- pip install wheel protobuf sphinx recommonmark virtualenv numpy sphinx_rtd_theme pre-commit - pip install wheel protobuf sphinx recommonmark virtualenv numpy sphinx_rtd_theme pre-commit requests==2.9.2 LinkChecker
script: script:
- paddle/scripts/travis/main.sh - paddle/scripts/travis/main.sh
notifications: notifications:
......
...@@ -7,6 +7,19 @@ source ./common.sh ...@@ -7,6 +7,19 @@ source ./common.sh
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=ON cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=ON
make paddle_docs paddle_docs_cn make paddle_docs paddle_docs_cn
# check websites for broken links
set +e
linkchecker doc/cn/html/index.html > doc_cn.out
linkchecker doc/en/html/index.html > doc_en.out
for i in doc_cn.out doc_en.out; do
echo $i
grep " 0 errors found" $i
if [ $? -ne 0 ]; then
cat $i
exit 1
fi
done
# Parse Github URL # Parse Github URL
REPO=`git config remote.origin.url` REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
...@@ -35,8 +48,8 @@ git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH ...@@ -35,8 +48,8 @@ git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
# remove old docs. mv new docs. # remove old docs. mv new docs.
rm -rf doc doc_cn rm -rf doc doc_cn
mv ../doc_cn/html doc_cn mv ../doc/cn/html doc_cn
mv ../doc/html doc mv ../doc/en/html doc
# Check is there anything changed. # Check is there anything changed.
set +e set +e
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册