From 127cc20a1d4065e1aeff8355ad75c84b14301d4d Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Fri, 7 Oct 2016 09:10:47 -0400 Subject: [PATCH] Install documentation for development branch separately. --- .ci/upload_docs.sh | 31 +++++++++++++++++++++++++------ .travis.yml | 37 ++++++++++++++++++++----------------- README.md | 3 +++ index.html | 13 +++++++++++++ 4 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 index.html diff --git a/.ci/upload_docs.sh b/.ci/upload_docs.sh index 0fc5c212..aa20838d 100755 --- a/.ci/upload_docs.sh +++ b/.ci/upload_docs.sh @@ -5,11 +5,19 @@ SOURCE_BRANCH="master" TARGET_BRANCH="gh-pages" # Pull requests and commits to other branches shouldn't try to deploy, just build to verify -if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ "$TRAVIS_BRANCH" != master -a "$TRAVIS_BRANCH" != develop ]; then +if [ "$TRAVIS_PULL_REQUEST" != "false" ] || \ + [ "$TRAVIS_BRANCH" != master -a \ + "$TRAVIS_BRANCH" != develop -a \ + "$TRAVIS_BRANCH" != travis ]; then echo "No docs to upload." exit 0 fi +if [ -z "$GH_TOKEN" ]; then + echo "Error: GH_TOKEN is undefined" + exit 1 +fi + # Save some useful information REPO=`git config remote.origin.url` SHA=`git rev-parse --verify HEAD` @@ -27,12 +35,23 @@ git remote add upstream "https://$GH_TOKEN@github.com/boostorg/python.git" git fetch upstream git reset upstream/gh-pages +# Prepare version. +if [ "$TRAVIS_BRANCH" = develop -o "$TRAVIS_BRANCH" = travis ]; then + mkdir -p develop/doc/ + cp ../index.html develop/ + cp ../doc/index.html develop/doc/ + cp -a doc/html develop/doc/ + git add develop/index.html + git add develop/doc/index.html + git add -A develop/doc/html +else + cp ../index.html . + cp ../doc/index.html doc/ + git add index.html + git add doc/index.html + git add -A doc/html +fi # Commit the new version. -cp ../index.html . -cp ../doc/index.html doc/ -git add index.html -git add doc/index.html -git add -A doc/html git commit -m "Deploy to GitHub Pages: ${SHA}" # Now that we're all set up, we can push. diff --git a/.travis.yml b/.travis.yml index 7f145526..1af4c095 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,23 +11,26 @@ dist: trusty language: cpp +env: + global: + - secure: BRNUkxN3p8f+uYKWC3Hr0VPqZA0PxbWr1DJlcI4hbiZtzKhMCWjDmd9UW9CzzexqeOxpd+9s0G87qvOur+wMSVxugDxtTesZrh1czXHeSVxgQrYD783XJtQJ9aYypbChkiboRD6Xpmbq7itwMuHBJMFtCuDxMynpU1jWwkyTf2Y= + matrix: include: - - compiler: gcc - env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++98 - - compiler: gcc - env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++11 - - compiler: gcc - env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++98 - - compiler: gcc - env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++11 - - compiler: clang - env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++98 - - compiler: clang - env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11 - - env: PYTHON=python DOC=1 - global: - - secure: pkZAwxzBDIVqGi+1LgZdnWjvd3cFuiTBZ2TryMWp4sy8B5EuCHoALOLwd8YreYNENJmZoZKdLXUhmMG82nLmzdWZiCvH2lavkimyHwjJYn6Qj6ayeDCwRvb6rXG6mdgNkQAhbkuDu6OJv0uvkcIU8fPom+ZLIABCPWs+gKNeOmA= + - compiler: gcc + env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++98 + - compiler: gcc + env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++11 + - compiler: gcc + env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++98 + - compiler: gcc + env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++11 + - compiler: clang + env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++98 + - compiler: clang + env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11 + - env: PYTHON=python DOC=1 + addons: apt: @@ -85,8 +88,8 @@ script: after_success: # Upload docs only when building upstream. - | - if [ "$DOC" -a - "$TRAVIS_REPO_SLUG" = "boostorg/python" -a + if [ "$DOC" -a \ + "$TRAVIS_REPO_SLUG" = "boostorg/python" -a \ "$TRAVIS_PULL_REQUEST" = "false" ]; then export GH_TOKEN .ci/upload_docs.sh diff --git a/README.md b/README.md index acad3817..c2ebefe2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ Welcome to Boost.Python, a C++ library which enables seamless interoperability b See the [Boost.Python](http://boostorg.github.io/python) documentation for details. +!!! note + Check out the [development version](http://boostorg.github.io/python/develop) of the documentation to see work in progress. + # Building ![Build Status](https://travis-ci.org/boostorg/python.svg?branch=develop) 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. diff --git a/index.html b/index.html new file mode 100644 index 00000000..1e1a2753 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Automatic redirection failed, click this + link  
+

© Copyright Stefan Seefeld, 2015

+

Distributed under the Boost Software License, Version 1.0. (See accompanying + file http://www.boost.org/LICENSE_1_0.txt)

+ +