Skip to content

Commit 4713f0a

Browse files
authored
Simplify the travis script. (#12557)
* Simplify the travis script. Now use docker to deploy documentations * Check for the pull request * Update paddle_build.sh * Update paddle_build.sh
1 parent 88a607c commit 4713f0a

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.travis.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ script:
2727
# 43min timeout
2828
paddle/scripts/paddle_docker_build.sh ${JOB}
2929
if [ $? -eq 0 ] || [ $? -eq 142 ]; then true; else exit 1; fi;
30-
- |
31-
if [[ "$JOB" != "doc" ]]; then exit 0; fi;
32-
# For document only
33-
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;
34-
if [[ "$TRAVIS_BRANCH" != "develop" && ! "$TRAVIS_BRANCH" =~ ^v|release/[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then exit 0; fi;
35-
export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/master/scripts/deploy/deploy_docs.sh
36-
export DOCS_DIR=`pwd`
37-
cd ..
38-
curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH $DOCS_DIR $DOCS_DIR/build/doc/
3930
notifications:
4031
email:
4132
on_success: change

paddle/scripts/paddle_build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,25 @@ EOF
419419
linkchecker doc/v2/en/html/index.html
420420
linkchecker doc/v2/cn/html/index.html
421421
linkchecker doc/v2/api/en/html/index.html
422+
423+
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;
424+
425+
# Deploy to the the content server if its a "develop" or "release/version" branch
426+
# The "develop_doc" branch is reserved to test full deploy process without impacting the real content.
427+
if [ "$TRAVIS_BRANCH" == "develop_doc" ]; then
428+
PPO_SCRIPT_BRANCH=develop
429+
elif [[ "$TRAVIS_BRANCH" == "develop" || "$TRAVIS_BRANCH" =~ ^v|release/[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then
430+
PPO_SCRIPT_BRANCH=master
431+
else
432+
# Early exit, this branch doesn't require documentation build
433+
return 0;
434+
fi
435+
# Fetch the paddlepaddle.org deploy_docs.sh from the appopriate branch
436+
export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/$PPO_SCRIPT_BRANCH/scripts/deploy/deploy_docs.sh
437+
export PYTHONPATH=$PYTHONPATH:${PADDLE_ROOT}/build/python:/paddle/build/python
438+
cd ..
439+
curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH ${PADDLE_ROOT} ${PADDLE_ROOT}/build/doc/ ${PPO_SCRIPT_BRANCH}
440+
cd -
422441
}
423442

424443
function gen_html() {

paddle/scripts/paddle_docker_build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ EOL
5252
${DOCKER_CMD} run -it \
5353
${DOCKER_ENV} \
5454
-e SCRIPT_NAME=$0 \
55+
-e CONTENT_DEC_PASSWD=$CONTENT_DEC_PASSWD \
56+
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
57+
-e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST \
5558
-v $PADDLE_ROOT:/paddle \
5659
-v ${HOME}/.ccache:/root/.ccache \
5760
-w /paddle \

0 commit comments

Comments
 (0)