Skip to content

Commit 1d83013

Browse files
authored
Update the deploy script. (#49)
* Start over * Added basic docs Added .travis.yml Added scripts to build documentation on the Travis. * Disable several deploy script commend for testing. * fixed the deploy_docs.sh script. * Update travis.yml * Renamed docs to doc * update .gitignore. * Delete .gitignore * Update .travis.yml * Update .travis.yml * Update deploy_docs.sh * Update .travis.yml * Develop doc (#1) * Add paddle submodule * Update the build script. * Update script * Use gen_doc_lib instead. * Move files around * cache external * Update submodule * try to cache batch 1 * add test code * Update Paddle submodule * Update submodule * update script to print more * update python path * test * test * test * clean up the code * Update Script (#2) * add new file * Develop doc (#3) * Add the rest of the submodules into the system * Provide first symlink fit a line * Update the rest of book to symlinks * add models submodule * Add link for models * Update deploy_docs * update to use lite 2 * Develop doc (#4) * Include the en book * Deploy mobile and models. * Use external approach.
1 parent bd86ac5 commit 1d83013

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818
- JOB=doc
1919
- JOB=lite_lib
2020
- JOB=lite_lib2
21+
- JOB=en_external_doc
2122

2223
addons:
2324
apt:
@@ -43,6 +44,10 @@ script:
4344
4445
if [ $JOB == "lite_lib2" ]; then scripts/build_doc_lib_lite2.sh
4546
fi
47+
48+
if [ $JOB == "en_external_doc" ]; then scripts/deploy_en_external_docs.sh
49+
fi
50+
4651
#before_cache:
4752
# # Save tagged docker images
4853
# - >

scripts/deploy_en_external_docs.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is used to deploy the English specific documents.
18+
# EX: Book, Mobile and Models. They are not yet consolidated into one Doc tree.
19+
20+
exit_code=0
21+
22+
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit $exit_code; fi;
23+
24+
# Deploy to the the content server if its a "develop" or "release/version" branch
25+
# The "develop_doc" branch is reserved to test full deploy process without impacting the real content.
26+
if [ "$TRAVIS_BRANCH" == "develop_doc" ]; then
27+
PPO_SCRIPT_BRANCH=develop
28+
elif [[ "$TRAVIS_BRANCH" == "develop" || "$TRAVIS_BRANCH" =~ ^v|release/[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then
29+
PPO_SCRIPT_BRANCH=master
30+
else
31+
# Early exit, this branch doesn't require documentation build
32+
echo "This branch doesn't require documentation build"
33+
exit $exit_code;
34+
fi
35+
36+
export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/$PPO_SCRIPT_BRANCH/scripts/deploy/deploy_docs.sh
37+
38+
echo "Deploy book under docker environment"
39+
docker run -it \
40+
-e CONTENT_DEC_PASSWD=$CONTENT_DEC_PASSWD \
41+
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
42+
-e DEPLOY_DOCS_SH=$DEPLOY_DOCS_SH \
43+
-e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST \
44+
-e PPO_SCRIPT_BRANCH=$PPO_SCRIPT_BRANCH \
45+
-e PADDLE_ROOT=/FluidDoc/external/Paddle \
46+
-e PYTHONPATH=/FluidDoc/external/Paddle/build/python \
47+
-v "$PWD:/FluidDoc" \
48+
-w /FluidDoc \
49+
paddlepaddle/paddle:latest-dev \
50+
/bin/bash -c 'curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH /FluidDoc/external /FluidDoc/external $PPO_SCRIPT_BRANCH' || exit_code=$(( exit_code | $? ))
51+
52+
exit $exit_code

0 commit comments

Comments
 (0)