File tree Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,13 @@ addons:
4242before_install :
4343 - |
4444 if [ ${JOB} == "BUILD_AND_TEST" ]; then
45- if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(\.rst$)|(\.jpg$)|(\.png$)'
46- then
47- echo "Only markdown docs were updated, stopping build process."
48- exit
45+ local change_list=`git diff --name-only $TRAVIS_COMMIT_RANGE`
46+ if [ $? -eq 0 ]; then # if git diff return no zero, then rerun unit test.
47+ if ! echo ${change_list} | grep -qvE '(\.md$)|(\.rst$)|(\.jpg$)|(\.png$)'
48+ then
49+ echo "Only markdown docs were updated, stopping build process."
50+ exit
51+ fi
4952 fi
5053 fi
5154 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi
Original file line number Diff line number Diff line change @@ -47,17 +47,20 @@ if [ $? -eq 0 ]; then
4747fi
4848set -e
4949
50- # Commit
51- git add .
52- git config user.name " Travis CI"
53- git config user.email
" [email protected] " 54- git commit -m " Deploy to GitHub Pages: ${SHA} "
55-
56- # Set ssh private key
57- openssl aes-256-cbc -K $SSL_KEY -iv $SSL_IV -in ../../paddle/scripts/travis/deploy_key.enc -out deploy_key -d
58- chmod 600 deploy_key
59- eval ` ssh-agent -s`
60- ssh-add deploy_key
61-
62- # Push
63- git push $SSH_REPO $TARGET_BRANCH
50+ if [ -n $SSL_KEY ]; then # Only push updated docs for github.com/PaddlePaddle/Paddle.
51+ # Commit
52+ git add .
53+ git config user.name " Travis CI"
54+ git config user.email
" [email protected] " 55+ git commit -m " Deploy to GitHub Pages: ${SHA} "
56+
57+ # Set ssh private key
58+ openssl aes-256-cbc -K $SSL_KEY -iv $SSL_IV -in ../../paddle/scripts/travis/deploy_key.enc -out deploy_key -d
59+ chmod 600 deploy_key
60+ eval ` ssh-agent -s`
61+ ssh-add deploy_key
62+
63+ # Push
64+ git push $SSH_REPO $TARGET_BRANCH
65+
66+ fi
You can’t perform that action at this time.
0 commit comments