Skip to content

Commit

Permalink
automatic develop doc deployment
Browse files Browse the repository at this point in the history
- build and deploy development docs from Travis-CI
- see #386 for details
- closes Issue #386

NOTE: The development docs are now visible at http://www.mdanalysis.org/mdanalysis/
      (so various URLs and forwarding for devdocs.mdanalysis.org need to be
      changed)
  • Loading branch information
orbeckst committed Sep 11, 2015
1 parent f8bdc80 commit 9817756
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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="
42 changes: 42 additions & 0 deletions maintainer/deploy_docs.sh
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"

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


0 comments on commit 9817756

Please sign in to comment.