diff --git a/.travis.yml b/.travis.yml index 7e480ccce6c..176170e6eb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: - export PATH=/home/travis/miniconda/bin:$PATH - conda update --yes conda install: - - conda create --yes -q -n pyenv mkl python=2.7 numpy=1.9.1 scipy=0.14.0 nose=1.3.7 + - conda create --yes -q -n pyenv mkl python=2.7 numpy=1.9.1 scipy=0.14.0 nose=1.3.7 sphinx=1.3 - source activate pyenv - conda install --yes python=$TRAVIS_PYTHON_VERSION cython biopython matplotlib networkx netcdf4 - pip install package/ @@ -27,6 +27,11 @@ install: # command to run tests script: - ./testsuite/MDAnalysisTests/mda_nosetests -v --with-coverage --cover-package MDAnalysis --processes=2 --process-timeout=120 --with-memleak + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && cd package/doc/sphinx && make clean html || true after_success: - coveralls - + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && bash maintainer/deploy_docs.sh + +env: + global: + secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY=" \ No newline at end of file diff --git a/maintainer/deploy_docs.sh b/maintainer/deploy_docs.sh new file mode 100755 index 00000000000..b29e6214886 --- /dev/null +++ b/maintainer/deploy_docs.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Deploying docs from travis-ci. +# See https://github.com/MDAnalysis/mdanalysis/issues/386 +# Script based on https://github.com/steveklabnik/automatically_update_github_pages_with_travis_example + +# Run this script from the top-level of the checked out git +# repository. A github OAuth token must be available in the evironment +# variable GH_TOKEN and is set up through the .travis.yml +# env:global:secure parameter (encrypted with travis-ci's public key)/ + +set -o errexit -o nounset + +function die () { + local msg="$1" err={$2:-1} + echo "ERROR: $msg [$err]" + exit $err +} + +DOCDIR="package/doc/html" +REPOSITORY="github.com/MDAnalysis/mdanalysis.git" + +rev=$(git rev-parse --short HEAD) + +test -n "${GH_TOKEN}" || die "GH_TOKEN is empty: need OAuth GitHub token to continue" 100 +cd $DOCDIR || die "Failed to 'cd $DOCDIR'. Run from the top level of the repository" + +git init +git config user.name "Travis CI" +git config user.email "TravisCI@mdanalysis.org" + +git remote add upstream "https://${GH_TOKEN}@${REPOSITORY}" +git fetch upstream +git reset upstream/gh-pages + +touch . +touch .nojekyll + +git add -A . +git commit -m "rebuild html docs with sphinx at ${rev}" +git push upstream HEAD:gh-pages + +