Skip to content

Commit

Permalink
Use doc-building CI scripts from msmbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
mpharrigan committed Mar 11, 2016
1 parent 15ae5f0 commit 7656557
Show file tree
Hide file tree
Showing 14 changed files with 432 additions and 211 deletions.
44 changes: 24 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
# Why are these needed?
- g++
- gfortran
- valgrind
Expand All @@ -13,29 +14,32 @@ addons:
- gcc-multilib

install:
- source devtools/travis-ci/install.sh
- export PYTHONUNBUFFERED=true
- export CC=gcc
- export CXX=g++
- source devtools/travis-ci/install_miniconda.sh
- source devtools/travis-ci/install_sparta.sh
- source devtools/travis-ci/install_ppm.sh
# Why is colli_r needed?
- conda config --add channels omnia colli_r

script:
- conda config --add channels omnia
- conda update -qy conda-build
- conda build -q devtools/conda-recipe
conda build --quiet devtools/conda-recipe
&& devtools/travis-ci/build_docs.sh

env:
matrix:
- CONDA_PY=27 CONDA_NPY=17
- CONDA_PY=27 CONDA_NPY=19
- CONDA_PY=34 CONDA_NPY=19
- CONDA_PY=35 CONDA_NPY=1.10
- CONDA_PY=2.7 CONDA_NPY=1.7
- CONDA_PY=2.7 CONDA_NPY=1.10
- CONDA_PY=3.4 CONDA_NPY=1.9
- CONDA_PY=3.5 CONDA_NPY=1.10

global:
# encrypted AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to push documentation to S3
- secure: "qrbibHwlbXBTq+8h1DC1plyUcl67qwn5yr4UYILdk9WsBhPdNT0ObpRUOcFDW/YM9RDfcOvx7Ruq/OPhvlVCg1C+Lj01kSx3vHxYCxFJVyN7iiD9oI/xzFUc6guvYF9O8um2+QE1ZI70yffGJGT7MZUQNUBnKchqvV3uIeSOqw4="
- secure: "Y4deQNbKXm0dTth0VoR59wEPYr0dNmp4Np+GDnJofwL+HKQ/w3dTrM3PQOV3bZ2w7WV2gAdtOv8MMUjdFYyyB+GS1wIZa4XbXchGNJr/lljvT3OP579ZwSLAowjEFFR6hidFDfMcR4D7KzTnoCIe9odXrZplI6l0M4OL1agki84="
# encrypted ANACONDA_TOKEN for push of dev package to binstar
- secure: "Fk6rmrCd4fnzkowd//FD9lI0bR3oNy1G2WjSke/1UiLtdZyCegiP0y0qcU5EIfEOoNk3NudM44RmPTHjqUMC7oS3tFI7SUBVUAyW34WOtTlOEaEBAzTDwfWhl6PLZNiXmZd75knjCyL6xJif4VwNT02VuMoR3ZchWG27ALpThwM="

after_success:
- source devtools/travis-ci/after_sucess.sh
deploy:
- provider: s3
access_key_id:
secure: "ZJrGD3DMlnokMNL2IAro43fdILptst27+UNH1tcma5NFSXGYRpUYAk+uFdjtj5WR2bi0g81UFmsGd421SfDzJe9WY+zcNlBTNlushi0+8KOTXBVr38n8z03mUMz2wnGTYmOg5z0kBHQ+xBVuX9Hz9FM9CVbWZczCWpTTiem35W4="
secret_access_key:
secure: "lEpUy2/GD2PnpBcv1KV2qt5mzRPbe4hPJwqlCuYDYvLFLMTrl+v5d+R8IyZ1KMX5eRBTPdP2i2sVbyRH/rwCaeRl6btYcsLWmpydfovPP7KyL3dlSWxtquOZCi0wfjlK7H5RwZHUb0870XhdPrAPT04plbiqVHzlSqBhfVTbHB0="
bucket: "mdtraj.org"
skip_cleanup: true
local_dir: docs/_deploy/
on:
branch: master
condition: "$CONDA_PY = 3.5"
19 changes: 0 additions & 19 deletions devtools/travis-ci/after_sucess.sh

This file was deleted.

27 changes: 27 additions & 0 deletions devtools/travis-ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Print each line, exit on error
set -ev

# Install the built package
conda create --yes -n docenv python=$CONDA_PY
source activate docenv
conda install -yq --use-local mdtraj-dev

# TODO: Use conda
# sphinx_rtd_theme's latest releases are not available
# neither is msmb_theme
# neither is sphinx > 1.3.1 (fix #1892 autodoc problem)
pip install -I sphinx==1.3.5 sphinx_rtd_theme==0.1.9 msmb_theme==1.2.0

# Install doc requirements
conda install --yes --file doc/requirements.txt

# Make docs
cd docs && make html && cd -

# Move the docs into a versioned subdirectory
python devtools/ci/set_doc_version.py

# Prepare versions.json
python devtools/ci/update_versions_json.py
55 changes: 0 additions & 55 deletions devtools/travis-ci/install.sh

This file was deleted.

15 changes: 15 additions & 0 deletions devtools/travis-ci/install_miniconda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
MINICONDA=Miniconda3-latest-Linux-x86_64.sh
MINICONDA_MD5=$(curl -s http://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget http://repo.continuum.io/miniconda/$MINICONDA
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
echo "Miniconda MD5 mismatch"
exit 1
fi
bash $MINICONDA -b
rm -f $MINICONDA

export PATH=$HOME/miniconda3/bin:$PATH

conda update -yq conda
conda install --yq conda-build jinja2
18 changes: 18 additions & 0 deletions devtools/travis-ci/install_ppm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Install ppm for NMR chemical shift predicition
MDTRAJ_DIR=`pwd`
mkdir -p $HOME/external
cd $HOME/external
wget http://mdtraj.org/travis-ci-cache/ppm_linux_64.exe
chmod a+x ppm_linux_64.exe
REFERENCE_MD5="f3cb5681bd2769cdcfc77fe17c563ee4"
RECEIVED_MD5=$(md5sum ppm_linux_64.exe | cut -d " " -f 1)
if [ $REFERENCE_MD5 != $RECEIVED_MD5 ]; then
echo "ppm_linux_64.exe md5 mismatch"
exit 1
fi

export PATH=`pwd`:$PATH
# go back to the original directory we were in
cd $MDTRAJ_DIR
23 changes: 23 additions & 0 deletions devtools/travis-ci/install_sparta.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Install SPARTA+ for NMR chemical shift predicition
MDTRAJ_DIR=`pwd`
mkdir -p $HOME/external
cd $HOME/external
wget http://mdtraj.org/travis-ci-cache/sparta+.tar.Z
REFERENCE_MD5="d4293336254f5696221db0edcc57cfed"
RECEIVED_MD5=$(md5sum sparta+.tar.Z | cut -d " " -f 1)
if [ $REFERENCE_MD5 != $RECEIVED_MD5 ]; then
echo "sparta+.tar.Z md5 mismatch"
exit 1
fi

tar -xzf sparta+.tar.Z
cd SPARTA+
csh ./install.com
export SPARTAP_DIR=`pwd`
export SPARTA_DIR=`pwd`
export PATH=`pwd`/bin:$PATH
# go back to the original directory we were in
cd $MDTRAJ_DIR

32 changes: 0 additions & 32 deletions devtools/travis-ci/push-docs-to-s3.py

This file was deleted.

12 changes: 12 additions & 0 deletions devtools/travis-ci/set_doc_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import shutil
from mdtraj import version

if version.release:
docversion = version.short_version
else:
docversion = 'development'

os.mkdir("doc/_deploy")
shutil.copytree("doc/_build/html", "doc/_deploy/{docversion}"
.format(docversion=docversion))
49 changes: 0 additions & 49 deletions devtools/travis-ci/update-versions.py

This file was deleted.

23 changes: 23 additions & 0 deletions devtools/travis-ci/update_versions_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import json
from urllib.request import urlopen
from mdtraj import version

if not version.release:
print("This is not a release.")
exit(0)

URL = 'http://www.msmbuilder.org'
versions = json.load(urlopen(URL + '/versions.json'))

# new release so all the others are now old
for i in range(len(versions)):
versions[i]['latest'] = False

versions.append({
'version': version.short_version,
'url': "{base}/{version}".format(base=URL, version=version.short_version),
'latest': True})

with open("doc/_deploy/versions.json", 'w') as versionf:
json.dump(versions, versionf)

Loading

0 comments on commit 7656557

Please sign in to comment.