Skip to content

Commit 3cba54a

Browse files
committed
remove unused document deployment function in build_doc.sh
1 parent f5ebd1a commit 3cba54a

File tree

1 file changed

+1
-75
lines changed

1 file changed

+1
-75
lines changed

paddle/scripts/travis/build_doc.sh

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -14,78 +14,4 @@ make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs
1414
# check websites for broken links
1515
linkchecker doc/v2/en/html/index.html
1616
linkchecker doc/v2/cn/html/index.html
17-
linkchecker doc/api/en/html/index.html
18-
19-
# Parse Github URL
20-
REPO=`git config remote.origin.url`
21-
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
22-
SHA=`git rev-parse --verify HEAD`
23-
24-
# Documentation branch name
25-
# gh-pages branch is used for PaddlePaddle.org. The English version of
26-
# documentation in `doc` directory, and the chinese version in `doc_cn`
27-
# directory.
28-
TARGET_BRANCH="gh-pages"
29-
30-
# Only deploy master branch to build latest documentation.
31-
SOURCE_BRANCH="master"
32-
33-
# Clone the repo to output directory
34-
mkdir output
35-
git clone $REPO output
36-
cd output
37-
38-
function deploy_docs() {
39-
SOURCE_BRANCH=$1
40-
DIR=$2
41-
# If is not a Github pull request
42-
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
43-
exit 0
44-
fi
45-
# If it is not watched branch.
46-
if [ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
47-
return
48-
fi
49-
50-
# checkout github page branch
51-
git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
52-
53-
mkdir -p ${DIR}
54-
# remove old docs. mv new docs.
55-
set +e
56-
rm -rf ${DIR}/doc ${DIR}/doc_cn ${DIR}/api_doc
57-
set -e
58-
cp -r ../doc/v2/cn/html ${DIR}/doc_cn
59-
cp -r ../doc/v2/en/html ${DIR}/doc
60-
cp -r ../doc/api/en/html ${DIR}/api_doc
61-
git add .
62-
}
63-
64-
deploy_docs "master" "."
65-
deploy_docs "develop" "./develop/"
66-
67-
# Check is there anything changed.
68-
set +e
69-
git diff --cached --exit-code >/dev/null
70-
if [ $? -eq 0 ]; then
71-
echo "No changes to the output on this push; exiting."
72-
exit 0
73-
fi
74-
set -e
75-
76-
if [ -n $SSL_KEY ]; then # Only push updated docs for github.com/PaddlePaddle/Paddle.
77-
# Commit
78-
git add .
79-
git config user.name "Travis CI"
80-
git config user.email "[email protected]"
81-
git commit -m "Deploy to GitHub Pages: ${SHA}"
82-
# Set ssh private key
83-
openssl aes-256-cbc -K $SSL_KEY -iv $SSL_IV -in ../../paddle/scripts/travis/deploy_key.enc -out deploy_key -d
84-
chmod 600 deploy_key
85-
eval `ssh-agent -s`
86-
ssh-add deploy_key
87-
88-
# Push
89-
git push $SSH_REPO $TARGET_BRANCH
90-
91-
fi
17+
linkchecker doc/v2/api/en/html/index.html

0 commit comments

Comments
 (0)