mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 18:52:26 +00:00
Automate documentation updates.
This commit is contained in:
39
.ci/upload_docs.sh
Executable file
39
.ci/upload_docs.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -e # Exit with nonzero exit code if anything fails
|
||||
|
||||
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
|
||||
echo "No docs to upload."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Save some useful information
|
||||
REPO=`git config remote.origin.url`
|
||||
SHA=`git rev-parse --verify HEAD`
|
||||
|
||||
# bin.SCons happens to contain the "doc/html" tree that we want to push
|
||||
# into the gh-pages branch. So we step into that directory, create a new repo,
|
||||
# set the remote appropriately, then commit and push.
|
||||
cd bin.SCons
|
||||
git init
|
||||
git config user.name "Travis CI"
|
||||
git config user.email "$COMMIT_AUTHOR_EMAIL"
|
||||
|
||||
# Make sure 'GH_TOKEN' is set (as 'secure' variable) in .travis.yml
|
||||
git remote add upstream "https://$GH_TOKEN@github.com/boostorg/python.git"
|
||||
git fetch upstream
|
||||
git reset upstream/gh-pages
|
||||
|
||||
# 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.
|
||||
git push -q upstream HEAD:gh-pages
|
||||
29
.travis.yml
29
.travis.yml
@@ -1,4 +1,3 @@
|
||||
# -*- python -*-
|
||||
#
|
||||
# Copyright (c) 2016 Stefan Seefeld
|
||||
# All rights reserved.
|
||||
@@ -7,18 +6,24 @@
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
language: cpp
|
||||
|
||||
env:
|
||||
- PYTHON=python CCFLAGS=-std=c++98
|
||||
- PYTHON=python CCFLAGS=-std=c++11
|
||||
- PYTHON=python3 CCFLAGS=-std=c++98
|
||||
- PYTHON=python3 CCFLAGS=-std=c++11
|
||||
matrix:
|
||||
- PYTHON=python CCFLAGS=-std=c++98
|
||||
- PYTHON=python CCFLAGS=-std=c++11
|
||||
- PYTHON=python3 CCFLAGS=-std=c++98
|
||||
- PYTHON=python3 CCFLAGS=-std=c++11
|
||||
- PYTHON=python DOC=1
|
||||
global:
|
||||
- secure: mqoxglbUN/At/r8O7nLVccGldnB1jvhLHNyYjfCXrdOD0GNX+TY2TS1+kIEv9Deg/P6X/QvrBa/ZzbDNryn3mDXBfOSy400ebSIUHHP3HtGHJShOGDyXedY3hZ/dqmxdV3p9hIxv4lcx1HPyC96s4wpiR0S9F1JBzD6scIabezM=
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
@@ -30,12 +35,18 @@ addons:
|
||||
- python-dev python-pip
|
||||
- python3-dev
|
||||
- libboost-all-dev
|
||||
|
||||
- xsltproc
|
||||
- python-docutils
|
||||
|
||||
before_install:
|
||||
- sudo pip install future
|
||||
- sudo pip install future
|
||||
|
||||
install:
|
||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||
|
||||
script: scons config --python=$PYTHON && scons && scons test
|
||||
script:
|
||||
- scons config --python=$PYTHON
|
||||
- if [ "$DOC" ]; then scons doc; else scons && scons test; fi
|
||||
|
||||
after_success:
|
||||
- if [ "$DOC" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then .ci/upload_docs.sh; fi
|
||||
|
||||
Reference in New Issue
Block a user