@@ -33,6 +33,7 @@ function print_usage() {
33
33
${BLUE} single_test${NONE} : run a single unit test
34
34
${BLUE} bind_test${NONE} : parallel tests bind to different GPU
35
35
${BLUE} doc${NONE} : generate paddle documents
36
+ ${BLUE} gen_doc_lib${NONE} : generate paddle documents library
36
37
${BLUE} html${NONE} : convert C++ source code into HTML
37
38
${BLUE} dockerfile${NONE} : generate paddle release dockerfile
38
39
${BLUE} capi${NONE} : generate paddle CAPI package
@@ -431,24 +432,60 @@ EOF
431
432
linkchecker doc/v2/cn/html/index.html
432
433
linkchecker doc/v2/api/en/html/index.html
433
434
434
- if [[ " $TRAVIS_PULL_REQUEST " != " false" ]]; then exit 0; fi ;
435
+ # if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;
436
+ #
437
+ # # Deploy to the the content server if its a "develop" or "release/version" branch
438
+ # # The "develop_doc" branch is reserved to test full deploy process without impacting the real content.
439
+ # if [ "$TRAVIS_BRANCH" == "develop_doc" ]; then
440
+ # PPO_SCRIPT_BRANCH=develop
441
+ # elif [[ "$TRAVIS_BRANCH" == "develop" || "$TRAVIS_BRANCH" =~ ^v|release/[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then
442
+ # PPO_SCRIPT_BRANCH=master
443
+ # else
444
+ # # Early exit, this branch doesn't require documentation build
445
+ # return 0;
446
+ # fi
447
+ # # Fetch the paddlepaddle.org deploy_docs.sh from the appopriate branch
448
+ # export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/$PPO_SCRIPT_BRANCH/scripts/deploy/deploy_docs.sh
449
+ # export PYTHONPATH=$PYTHONPATH:${PADDLE_ROOT}/build/python:/paddle/build/python
450
+ # cd ..
451
+ # curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH ${PADDLE_ROOT} ${PADDLE_ROOT}/build/doc/ ${PPO_SCRIPT_BRANCH}
452
+ # cd -
453
+ }
435
454
436
- # Deploy to the the content server if its a "develop" or "release/version" branch
437
- # The "develop_doc" branch is reserved to test full deploy process without impacting the real content.
438
- if [ " $TRAVIS_BRANCH " == " develop_doc" ]; then
439
- PPO_SCRIPT_BRANCH=develop
440
- elif [[ " $TRAVIS_BRANCH " == " develop" || " $TRAVIS_BRANCH " =~ ^v| release/[[:digit:]]+\. [[:digit:]]+ (\. [[:digit:]]+)? (-\S * )? $ ]]; then
441
- PPO_SCRIPT_BRANCH=master
442
- else
443
- # Early exit, this branch doesn't require documentation build
444
- return 0;
445
- fi
446
- # Fetch the paddlepaddle.org deploy_docs.sh from the appopriate branch
447
- export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/$PPO_SCRIPT_BRANCH /scripts/deploy/deploy_docs.sh
448
- export PYTHONPATH=$PYTHONPATH :${PADDLE_ROOT} /build/python:/paddle/build/python
449
- cd ..
450
- curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH ${PADDLE_ROOT} ${PADDLE_ROOT} /build/doc/ ${PPO_SCRIPT_BRANCH}
451
- cd -
455
+ function gen_doc_lib() {
456
+ mkdir -p ${PADDLE_ROOT} /build
457
+ cd ${PADDLE_ROOT} /build
458
+ cat << EOF
459
+ ========================================
460
+ Building documentation library ...
461
+ In /paddle/build
462
+ ========================================
463
+ EOF
464
+ cmake .. \
465
+ -DCMAKE_BUILD_TYPE=Release \
466
+ -DWITH_DOC=ON \
467
+ -DWITH_GPU=OFF \
468
+ -DWITH_MKL=OFF \
469
+ -DWITH_FLUID_ONLY=ON
470
+
471
+ local LIB_TYPE=$1
472
+ case $LIB_TYPE in
473
+ full)
474
+ # Build full Paddle Python module. Will timeout without caching 'copy_paddle_pybind' first
475
+ make -j ` nproc` gen_proto_py framework_py_proto copy_paddle_pybind paddle_python
476
+ ;;
477
+ pybind)
478
+ # Build paddle pybind library. Takes 49 minutes to build. Might timeout
479
+ make -j ` nproc` copy_paddle_pybind
480
+ ;;
481
+ proto)
482
+ # Even smaller library.
483
+ make -j ` nproc` framework_py_proto
484
+ ;;
485
+ * )
486
+ exit 0
487
+ ;;
488
+ esac
452
489
}
453
490
454
491
function gen_html() {
@@ -608,6 +645,9 @@ function main() {
608
645
doc)
609
646
gen_docs
610
647
;;
648
+ gen_doc_lib)
649
+ gen_doc_lib $2
650
+ ;;
611
651
html)
612
652
gen_html
613
653
;;
0 commit comments