diff --git a/.travis.yml b/.travis.yml index b329467..6298808 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,20 @@ language: python python: 2.7 sudo: false env: + matrix: - TOX_ENV=py26 - TOX_ENV=py27 - TOX_ENV=py33 - TOX_ENV=py34 - TOX_ENV=pypy + global: + secure: Dxq/BYQ9e2GVyQQifNGhw3R1AHhUAiJuS4L/ow23IAYWO6wd9ZPGSjyn6C+VJRwlEXXwhkYSzOuJdfr+FR5sENMRAwIx1z2gOzOjxaLZRxm1bLDnUlP0wld+0m4UwLMZuLzA30gSR6RZo+S6IGhYCiFYmpDqSgwQihIM2vOmUz4= install: - - pip install tox +- pip install tox script: - - tox -e $TOX_ENV +- tox -e $TOX_ENV +- [ $TRAVIS_BRANCH = master ] && tox -e pushdocs after_success: - - tox -e coveralls +- tox -e coveralls notifications: email: false diff --git a/scripts/push-docs b/scripts/push-docs new file mode 100644 index 0000000..f233016 --- /dev/null +++ b/scripts/push-docs @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Push a new version of the docs. + +if [[ "${TRAVIS_BRANCH}" == "master" ]] && \ + [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then + ghp-import -n docs/_build/html + git push -fq https://${GH_OAUTH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages +fi diff --git a/tox.ini b/tox.ini index 42b1f57..46724cd 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,9 @@ basepython = python2.7 deps = {[testenv:docs]deps} ghp-import -commands = {toxinidir}/scripts/push-docs +commands = + {toxinidir}/scripts/build-docs + {toxinidir}/scripts/push-docs [testenv:py26] basepython = python2.6