Skip to content

Commit 127cc20

Browse files
committed
Install documentation for development branch separately.
1 parent 482219f commit 127cc20

File tree

4 files changed

+61
-23
lines changed

4 files changed

+61
-23
lines changed

.ci/upload_docs.sh

+25-6
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://[email protected]/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

+20-17
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@ dist: trusty
1111

1212
language: cpp
1313

14+
env:
15+
global:
16+
- secure: BRNUkxN3p8f+uYKWC3Hr0VPqZA0PxbWr1DJlcI4hbiZtzKhMCWjDmd9UW9CzzexqeOxpd+9s0G87qvOur+wMSVxugDxtTesZrh1czXHeSVxgQrYD783XJtQJ9aYypbChkiboRD6Xpmbq7itwMuHBJMFtCuDxMynpU1jWwkyTf2Y=
17+
1418
matrix:
1519
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
29-
global:
30-
- secure: pkZAwxzBDIVqGi+1LgZdnWjvd3cFuiTBZ2TryMWp4sy8B5EuCHoALOLwd8YreYNENJmZoZKdLXUhmMG82nLmzdWZiCvH2lavkimyHwjJYn6Qj6ayeDCwRvb6rXG6mdgNkQAhbkuDu6OJv0uvkcIU8fPom+ZLIABCPWs+gKNeOmA=
20+
- compiler: gcc
21+
env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++98
22+
- compiler: gcc
23+
env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++11
24+
- compiler: gcc
25+
env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++98
26+
- compiler: gcc
27+
env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++11
28+
- compiler: clang
29+
env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++98
30+
- compiler: clang
31+
env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11
32+
- env: PYTHON=python DOC=1
33+
3134

3235
addons:
3336
apt:
@@ -85,8 +88,8 @@ script:
8588
after_success:
8689
# Upload docs only when building upstream.
8790
- |
88-
if [ "$DOC" -a
89-
"$TRAVIS_REPO_SLUG" = "boostorg/python" -a
91+
if [ "$DOC" -a \
92+
"$TRAVIS_REPO_SLUG" = "boostorg/python" -a \
9093
"$TRAVIS_PULL_REQUEST" = "false" ]; then
9194
export GH_TOKEN
9295
.ci/upload_docs.sh

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Welcome to Boost.Python, a C++ library which enables seamless interoperability b
1717

1818
See the [Boost.Python](http://boostorg.github.io/python) documentation for details.
1919

20+
!!! note
21+
Check out the [development version](http://boostorg.github.io/python/develop) of the documentation to see work in progress.
22+
2023
# Building ![Build Status](https://travis-ci.org/boostorg/python.svg?branch=develop)
2124

2225
While Boost.Python is part of the Boost C++ Libraries super-project, and thus can be compiled as part of Boost, it can also be compiled and installed stand-alone, i.e. against a pre-installed Boost package.

index.html

+13
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)