Commit f4872610 by John Chodera (MSKCC)

Refresh travis/devtools

parent 992e0987
language: c
sudo: false
env:
matrix:
- CONDA_PY=2.7
- CONDA_PY=3.3
- CONDA_PY=3.4
global:
# BINSTAR_TOKEN
- secure: "T7qEO3BVXdEP3J4bqE8X882KrdGD4L0cwbAjX/SZMm8e8bG/qmv7XWkxIDp/HakR5GlGr3EBGQDJi5g2CbmFwHjxXMbZ4Y0a3dvoCvfdBNUpBZcjPSil2X976aEkTR1MAL8X7VjuY4lwogqO2WU7Kzm1QaFWjWEl1fV/zxHYN9w="
addons:
apt:
sources:
- ubuntu-toolchain-r-test
install:
- source devtools/travis-ci/install.sh
- bash -x devtools/travis-ci/install.sh
- export PYTHONUNBUFFERED=true
- export PATH=$HOME/miniconda/bin:$PATH
script:
# Build the conda package, running tests as part of the build.
# Add conda channel
- conda config --add channels $ORGNAME
# Build the recipe
- conda build devtools/conda-recipe
after_script:
# Run pyflakes.
# Test the local installation
- source activate _test
- conda install --yes --quiet nose nose-timer
- cd devtools && nosetests $PACKAGENAME --nocapture --verbosity=2 --with-doctest --with-timer -a "\!slow" && cd ..
# Run pyflakes
- pyflakes pdbfixer/*.py
env:
matrix:
- python=2.7 CONDA_PY=27
- python=3.4 CONDA_PY=34
- python=3.5 CONDA_PY=35
global:
- ORGNAME="omnia" # the name of the organization
- PACKAGENAME="pdbfixer" # the name of your package
# encrypted BINSTAR_TOKEN for push of dev package to binstar
- secure: "T7qEO3BVXdEP3J4bqE8X882KrdGD4L0cwbAjX/SZMm8e8bG/qmv7XWkxIDp/HakR5GlGr3EBGQDJi5g2CbmFwHjxXMbZ4Y0a3dvoCvfdBNUpBZcjPSil2X976aEkTR1MAL8X7VjuY4lwogqO2WU7Kzm1QaFWjWEl1fV/zxHYN9w="
after_success:
- echo "after_success"
- bash devtools/travis-ci/after_success.sh
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ]; then source devtools/travis-ci/after_success.sh; fi
#!/bin/bash
# Must be invoked with $PACKAGENAME
echo "Travis pull request: $TRAVIS_PULL_REQUEST"
echo "Travis branch: $TRAVIS_BRANCH"
echo $TRAVIS_PULL_REQUEST $TRAVIS_BRANCH
PUSH_DOCS_TO_S3=false
if [[ "$TRAVIS_PULL_REQUEST" == "true" ]]; then
if [ "$TRAVIS_PULL_REQUEST" = true ]; then
echo "This is a pull request. No deployment will be done."; exit 0
fi
if [[ "$TRAVIS_BRANCH" != "master" ]]; then
if [ "$TRAVIS_BRANCH" != "master" ]; then
echo "No deployment on BRANCH='$TRAVIS_BRANCH'"; exit 0
fi
# Deploy to binstar.
# Deploy to binstar
conda install --yes anaconda-client jinja2
binstar -t $BINSTAR_TOKEN upload --force -u omnia -p pdbfixer-dev $HOME/miniconda/conda-bld/*/pdbfixer-dev-*.tar.bz2
pushd .
cd $HOME/miniconda/conda-bld
FILES=*/${PACKAGENAME}-dev-*.tar.bz2
for filename in $FILES; do
anaconda -t $BINSTAR_TOKEN remove --force ${ORGNAME}/${PACKAGENAME}-dev/${filename}
anaconda -t $BINSTAR_TOKEN upload --force -u ${ORGNAME} -p ${PACKAGENAME}-dev ${filename}
done
popd
if [ $PUSH_DOCS_TO_S3 = true ]; then
# Create the docs and push them to S3
# -----------------------------------
conda install --yes pip
conda config --add channels $ORGNAME
conda install --yes `conda build devtools/conda-recipe --output`
pip install numpydoc s3cmd msmb_theme
conda install --yes `cat docs/requirements.txt | xargs`
conda list -e
(cd docs && make html && cd -)
ls -lt docs/_build
pwd
python devtools/ci/push-docs-to-s3.py
fi
<html><head><meta http-equiv="refresh" content="0;URL='/latest'"/></head></html>
# Temporarily change directory to $HOME to install software
pushd .
cd $HOME
# Install Miniconda
MINICONDA=Miniconda-latest-Linux-x86_64.sh
MINICONDA_HOME=$HOME/miniconda
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
wget -q 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
PIP_ARGS="-U"
export PATH=$HOME/miniconda/bin:$PATH
bash $MINICONDA -b -p $MINICONDA_HOME
# Configure miniconda
export PIP_ARGS="-U"
export PATH=$MINICONDA_HOME/bin:$PATH
conda update --yes conda
conda config --add channels http://conda.binstar.org/omnia
conda install --yes conda-build jinja2 anaconda-client pip
# Restore original directory
popd
#!/usr/bin/env python
"""
Must have the vollowing environment variables defined:
* BUCKET_NAME : AWS bucket name
* PREFIX : 'latest' or other version number
"""
import os
import pip
import tempfile
import subprocess
import thermopyl.version
BUCKET_NAME = 'thermopyl.org'
if not thermopyl.version.release:
PREFIX = 'latest'
else:
PREFIX = thermopyl.version.short_version
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
raise ImportError('The s3cmd pacakge is required. try $ pip install s3cmd')
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
with tempfile.NamedTemporaryFile('w') as f:
f.write('''[default]
access_key = {AWS_ACCESS_KEY_ID}
secret_key = {AWS_SECRET_ACCESS_KEY}
'''.format(**os.environ))
f.flush()
template = ('s3cmd --guess-mime-type --config {config} '
'sync docs/_build/ s3://{bucket}/{prefix}/')
cmd = template.format(
config=f.name,
bucket=BUCKET_NAME,
prefix=PREFIX)
return_val = subprocess.call(cmd.split())
# Sync index file.
template = ('s3cmd --guess-mime-type --config {config} '
'sync devtools/ci/index.html s3://{bucket}/')
cmd = template.format(
config=f.name,
bucket=BUCKET_NAME)
return_val = subprocess.call(cmd.split())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment