diff --git a/.travis.yml b/.travis.yml index c9b817c9c..0f00aee8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,26 @@ language: python +env: + global: + - GH_REPO: github.com/dsten/datascience.git + - secure: "Ndq+rOhIGAOSb1wRUCayt0TjGGikJrZOOkS1b4Qi1qFyDzrJdWy80B6fd6ZslRWNAg1YKuvj2nbCOlaXL4gC4uXjZO8ag7tRnUCW8aCp9qJtVxLVGf43Yk+tKaTdPajgmBAEw785Ua0LmTrZRTvUQzybPd4BFQVnLQ9CQ7N0KFT0COtCLC5SJaBy3/sclodaDVv2zGv/WzQPsqtsyDqi5emz43WA8EsjieSNh9rbegY5i9TijjSyt4+sR9YTSakqR6/7vvDdhLZvPkbzAJNlvy1v1FkDNtv3QKHV05Nj17UDyXeF/gs3FmkioiZdtxswF9YZBAAXuc3Lo/fOQyBjS5HPPylSkq2gBVAWSRwcSKdz0CTO4Re2YKrFigWpbm/zJzT/O+8vRrYKoejyqNweO7gRwlumVPrmyUph0wvN8XTvm01np6ZUHMgaCLS2kKLjr8fZ9l+aah3EubGx5Qp2wPAx+IC2rqLjjkibd41g3zG7DGR+r9HwW20K4VjbptTHKTHICi6rvq9HiLqBEKH6Cmv+hF4h5rwH71apcZzFaxGt/KYEsX11T1BalA0FwVn8pKZSacsh8jNMnkWgv+5G5dqwocURKUBY4x1VoCXqbvQ8mPjX88ookr3hbvpxXwkwAltGMo3H8Y7a5JcGxU4w/NXm6VSRxkukHrLtnKa8kNQ=" python: - "3.4.2" - -script: - - coverage run setup.py test - - install: - - pip install pip --upgrade + - pip install pip sphinx --upgrade - python3 setup.py install +script: + - coverage run setup.py test after_success: - coveralls - + - bash deploy_docs.sh sudo: false - cache: directories: - - /home/travis/virtualenv/python3.4.2/ \ No newline at end of file + - /home/travis/virtualenv/python3.4.2/ diff --git a/Makefile b/Makefile index 89b55db1f..3ceae00bd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .PHONY: help docs serve_docs install test deploy_docs DOCS_DIR = docs +GH_REMOTE = origin help: @echo "Please use 'make ' where is one of:" @@ -27,7 +28,6 @@ serve_docs: cd $(DOCS_DIR)/_build/html ; python -m http.server deploy_docs: - git checkout master git subtree split --prefix $(DOCS_DIR)/_build/html -b gh-pages - git push -f origin gh-pages:gh-pages + git push -f $(GH_REMOTE) gh-pages:gh-pages git branch -D gh-pages diff --git a/deploy_docs.sh b/deploy_docs.sh new file mode 100755 index 000000000..baa4354e9 --- /dev/null +++ b/deploy_docs.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# This script is used by Travis to automatically push the docs to the gh-pages +# branch of the datascience repo. + +set -e # exit with nonzero exit code if anything fails + +# Only build docs on master branch +if [ $(git rev-parse --abbrev-ref HEAD) != master ]; then + echo "Not building docs since we're not on the master branch." + exit 0 +fi + +git config user.name "Travis CI" +git config user.email "travis@travis.com" + +make docs + +git add -A docs +git commit -m "[Travis] Build documentation" + +make deploy_docs GH_REMOTE="https://${GH_TOKEN}@${GH_REPO}" diff --git a/docs/conf.py b/docs/conf.py index 13a7074ee..67538bafb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,6 +17,7 @@ import os import shlex +sys.path.insert(0, '../') from version import VERSION # If extensions (or modules to document with autodoc) are in another directory,