Skip to content

Commit 9d96b5a

Browse files
committed
Install documentation for development branch separately.
1 parent 482219f commit 9d96b5a

3 files changed

Lines changed: 58 additions & 24 deletions

File tree

.ci/upload_docs.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ SOURCE_BRANCH="master"
55
TARGET_BRANCH="gh-pages"
66

77
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
8-
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ "$TRAVIS_BRANCH" != master -a "$TRAVIS_BRANCH" != develop ]; then
8+
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || \
9+
[ "$TRAVIS_BRANCH" != master -a \
10+
"$TRAVIS_BRANCH" != develop -a \
11+
"$TRAVIS_BRANCH" != travis ]; then
912
echo "No docs to upload."
1013
exit 0
1114
fi
1215

16+
if [ -z "$GH_TOKEN" ]; then
17+
echo "Error: GH_TOKEN is undefined"
18+
exit 1
19+
fi
20+
1321
# Save some useful information
1422
REPO=`git config remote.origin.url`
1523
SHA=`git rev-parse --verify HEAD`
@@ -27,12 +35,23 @@ git remote add upstream "https://$GH_TOKEN@github.com/boostorg/python.git"
2735
git fetch upstream
2836
git reset upstream/gh-pages
2937

38+
# Prepare version.
39+
if [ "$TRAVIS_BRANCH" = develop -o "$TRAVIS_BRANCH" = travis ]; then
40+
mkdir -p develop/doc/
41+
cp ../index.html develop/
42+
cp ../doc/index.html develop/doc/
43+
cp -a doc/html develop/doc/
44+
git add develop/index.html
45+
git add develop/doc/index.html
46+
git add -A develop/doc/html
47+
else
48+
cp ../index.html .
49+
cp ../doc/index.html doc/
50+
git add index.html
51+
git add doc/index.html
52+
git add -A doc/html
53+
fi
3054
# Commit the new version.
31-
cp ../index.html .
32-
cp ../doc/index.html doc/
33-
git add index.html
34-
git add doc/index.html
35-
git add -A doc/html
3655
git commit -m "Deploy to GitHub Pages: ${SHA}"
3756

3857
# Now that we're all set up, we can push.

.travis.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@ dist: trusty
1111

1212
language: cpp
1313

14-
matrix:
15-
include:
16-
- compiler: gcc
17-
env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++98
18-
- compiler: gcc
19-
env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++11
20-
- compiler: gcc
21-
env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++98
22-
- compiler: gcc
23-
env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++11
24-
- compiler: clang
25-
env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++98
26-
- compiler: clang
27-
env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11
28-
- env: PYTHON=python DOC=1
14+
env:
15+
matrix:
16+
include:
17+
- compiler: gcc
18+
env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++98
19+
- compiler: gcc
20+
env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++11
21+
- compiler: gcc
22+
env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++98
23+
- compiler: gcc
24+
env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++11
25+
- compiler: clang
26+
env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++98
27+
- compiler: clang
28+
env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11
29+
- env: PYTHON=python DOC=1
2930
global:
30-
- secure: pkZAwxzBDIVqGi+1LgZdnWjvd3cFuiTBZ2TryMWp4sy8B5EuCHoALOLwd8YreYNENJmZoZKdLXUhmMG82nLmzdWZiCvH2lavkimyHwjJYn6Qj6ayeDCwRvb6rXG6mdgNkQAhbkuDu6OJv0uvkcIU8fPom+ZLIABCPWs+gKNeOmA=
31+
- secure: BRNUkxN3p8f+uYKWC3Hr0VPqZA0PxbWr1DJlcI4hbiZtzKhMCWjDmd9UW9CzzexqeOxpd+9s0G87qvOur+wMSVxugDxtTesZrh1czXHeSVxgQrYD783XJtQJ9aYypbChkiboRD6Xpmbq7itwMuHBJMFtCuDxMynpU1jWwkyTf2Y=
32+
3133

3234
addons:
3335
apt:
@@ -85,8 +87,8 @@ script:
8587
after_success:
8688
# Upload docs only when building upstream.
8789
- |
88-
if [ "$DOC" -a
89-
"$TRAVIS_REPO_SLUG" = "boostorg/python" -a
90+
if [ "$DOC" -a \
91+
"$TRAVIS_REPO_SLUG" = "boostorg/python" -a \
9092
"$TRAVIS_PULL_REQUEST" = "false" ]; then
9193
export GH_TOKEN
9294
.ci/upload_docs.sh

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<html>
3+
<head>
4+
<meta http-equiv="refresh" content="0; URL=doc/index.html">
5+
</head>
6+
<body>
7+
Automatic redirection failed, click this
8+
<a href="doc/index.html">link</a> &nbsp;<hr>
9+
<p>© Copyright Stefan Seefeld, 2015</p>
10+
<p>Distributed under the Boost Software License, Version 1.0. (See accompanying
11+
file <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)